Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions zephyr/samples/profiles/b-ld/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,25 @@ Compile this sample for the `rpi_pico` board:
Compile this sample for the `adafruit_grand_central_m4_express` board with

west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-ld/

Using the Shell
***************

The shell is available on some boards via virtual communication port:

picocom --baud 115200 /dev/ttyACM0

Terminal ready
*** Booting Zephyr OS build v3.7.0 ***
[00:00:00.012,000] <inf> bacnet: BACnet Device: BACnet Lighting Device (B-LD)
[00:00:00.012,000] <inf> bacnet: BACnet Stack Version 1.4.1
[00:00:00.012,000] <inf> bacnet: BACnet Stack Max APDU: 1476
uart:~$
bacnet clear device devmem help history kernel net
rem resize retval shell stats
uart:~$ bacnet objects
{"object-list": [
{"object-identifier":{"device":4194303}},
{"object-identifier":{"network-port":0}},
{"object-identifier":{"lighting-output":1}}],
"object-list-size": 3}
27 changes: 26 additions & 1 deletion zephyr/samples/profiles/b-ls/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,29 @@ Compile this sample for the `rpi_pico` board:

Compile this sample for the `adafruit_grand_central_m4_express` board with

west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-ld/
west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-ls/

Using the Shell
***************

The shell is available on some boards via virtual communication port:

picocom --baud 115200 /dev/ttyACM0

Terminal ready
*** Booting Zephyr OS build v3.7.0 ***
[00:00:00.012,000] <inf> bacnet: BACnet Device: BACnet Lighting Supervisor (B-LS)
[00:00:00.012,000] <inf> bacnet: BACnet Stack Version 1.4.1
[00:00:00.012,000] <inf> bacnet: BACnet Stack Max APDU: 1476
uart:~$
bacnet clear device devmem help history kernel net
rem resize retval shell stats
uart:~$ bacnet objects
{"object-list": [
{"object-identifier":{"device":260126}},
{"object-identifier":{"network-port":0}},
{"object-identifier":{"lighting-output":1}},
{"object-identifier":{"channel":1}},
{"object-identifier":{"binary-lighting-output":1}}],
"object-list-size": 5}

24 changes: 23 additions & 1 deletion zephyr/samples/profiles/b-sa/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,26 @@ Compile this sample for the `rpi_pico` board:

Compile this sample for the `adafruit_grand_central_m4_express` board with

west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-ld/
west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-sa/

Using the Shell
***************

The shell is available on some boards via virtual communication port:

picocom --baud 115200 /dev/ttyACM0

Terminal ready
*** Booting Zephyr OS build v3.7.0 ***
[00:00:00.012,000] <inf> bacnet: BACnet Device: BACnet Smart Actuator (B-SA)
[00:00:00.012,000] <inf> bacnet: BACnet Stack Version 1.4.1
[00:00:00.012,000] <inf> bacnet: BACnet Stack Max APDU: 1476
uart:~$
bacnet clear device devmem help history kernel net
rem resize retval shell stats
uart:~$ bacnet objects
{"object-list": [
{"object-identifier":{"device":260124}},
{"object-identifier":{"analog-output":1}},
{"object-identifier":{"network-port":0}}],
"object-list-size": 3}
24 changes: 23 additions & 1 deletion zephyr/samples/profiles/b-ss/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,26 @@ Compile this sample for the `rpi_pico` board:

Compile this sample for the `adafruit_grand_central_m4_express` board with

west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-ld/
west build -b adafruit_grand_central_m4_express -p always bacnet/zephyr/samples/profiles/b-ss/

Using the Shell
***************

The shell is available on some boards via virtual communication port:

picocom --baud 115200 /dev/ttyACM0

Terminal ready
*** Booting Zephyr OS build v3.7.0 ***
[00:00:00.012,000] <inf> bacnet: BACnet Device: BACnet Smart Sensor (B-SS)
[00:00:00.012,000] <inf> bacnet: BACnet Stack Version 1.4.1
[00:00:00.012,000] <inf> bacnet: BACnet Stack Max APDU: 1476
uart:~$
bacnet clear device devmem help history kernel net
rem resize retval shell stats
uart:~$ bacnet objects
{"object-list": [
{"object-identifier":{"device":4194303}},
{"object-identifier":{"analog-input":1}},
{"object-identifier":{"network-port":0}}],
"object-list-size": 3}
11 changes: 7 additions & 4 deletions zephyr/subsys/bacnet_shell/bacnet_shell_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ static int cmd_objects(const struct shell *sh, size_t argc, char **argv)

(void)argc;
(void)argv;
shell_print(sh, "List of BACnet Objects: [{");
/* display the object-list as well formed JSON */
shell_print(sh, "{\"%s\": [", bactext_property_name(PROP_OBJECT_LIST));
count = Device_Object_List_Count();
for (array_index = 1; array_index <= count; array_index++) {
found = Device_Object_List_Identifier(array_index, &object_type, &instance);
if (found) {
shell_print(sh, " \"%s-%u\"%c", bactext_object_type_name(object_type),
instance, (array_index == count) ? ' ' : ',');
shell_print(sh, "{\"%s\":{\"%s\":%u}}%s",
bactext_property_name(PROP_OBJECT_IDENTIFIER),
bactext_object_type_name(object_type), instance,
(array_index == count) ? "]," : ",");
}
}
shell_print(sh, "}] -- %d objects found", count);
shell_print(sh, "\"object-list-size\": %d}", count);

return 0;
}
Expand Down