Conversation
f40d115 to
a985902
Compare
01b3145 to
c2d105b
Compare
sam-golioth
left a comment
There was a problem hiding this comment.
Awesome stuff, @mniestroj! Left a few comments on some organizational/docs stuff
|
|
||
| config POUCH_GATEWAY_NUM_BLOCKS | ||
| int "Number of blocks in downlink/uplink buffer" | ||
| default 10 | ||
| help | ||
| The number of blocks available for buffering uplink or downlink | ||
| data between a node device and the cloud. Each block is equal | ||
| to CONFIG_GOLIOTH_BLOCKWISE_UPLOAD_MAX_BLOCK_SIZE in length. | ||
|
|
||
| config POUCH_GATEWAY_DEVICE_CERT_MAX_LEN | ||
| int "Device certificate maximum length" | ||
| default 1024 | ||
| help | ||
| Maximum length of device certificate. | ||
|
|
||
| config POUCH_GATEWAY_SERVER_CERT_MAX_LEN | ||
| int "Server certificate maximum length" | ||
| default 4096 | ||
| help | ||
| Maximum length of server certificate. | ||
|
|
||
| config POUCH_GATEWAY_DOWNLINK_BLOCK_TIMEOUT | ||
| int "Downlink timeout" | ||
| default 10 | ||
| help | ||
| The time in seconds that the downlink module will wait for a | ||
| block to become available in the buffer. This should be larger | ||
| than the duration it takes to send one block to the node device. | ||
|
|
||
| config POUCH_GATEWAY_CLOUD | ||
| bool "Send pouches to cloud" | ||
| default y | ||
|
|
||
| config POUCH_GATEWAY_SERVER_CERT_BUILTIN | ||
| bool | ||
| default y if !POUCH_GATEWAY_CLOUD |
There was a problem hiding this comment.
Should we have these guarded by if POUCH_GATEWAY?
There was a problem hiding this comment.
Good idea, added such guard.
| * @param dst_len Length of the destination buffer. | ||
| * @param is_last true if this is the last chunk. |
There was a problem hiding this comment.
We should denote that dst_len is in/out and is_last is out
| * @param dst_len Length of the destination buffer. | |
| * @param is_last true if this is the last chunk. | |
| * @param dst_len[in,out] Length of the destination buffer. Set to the number of bytes written. | |
| * @param is_last[out] Set to true if this is the last chunk. |
There was a problem hiding this comment.
Added those changes.
| config POUCH_GATEWAY_CLOUD | ||
| bool "Send pouches to cloud" | ||
| default y | ||
| help | ||
| Disabling cloud communication allows to test Bluetooth gateway | ||
| functionality without relying on communication with backend. All | ||
| pouches received from Bluetooth nodes are dropped in that case. | ||
|
|
||
| config GOLIOTH_COAP_HOST_URI | ||
| string "CoAP server URI" | ||
| default "coaps://coap.golioth.io" | ||
| help | ||
| The URI of the CoAP server. | ||
|
|
||
| endmenu |
There was a problem hiding this comment.
Aren't these options provided by the Gateway lib and the Golioth Firmware SDK?
There was a problem hiding this comment.
GOLIOTH_COAP_HOST_URI is provided by Golioth SDK. Here we move that to sysbuild context, so it can be set by SB_CONFIG_GOLIOTH_COAP_HOST_URI option when using using sysbuild (e.g. west build ... --sysbuild). By having that on sysbuild level, we can adjust all components in sysbuild, which in case of nrf52_bsim are both "bluetooth gateway" as well "pouch peripheral". I case of "bluetooth gateway" we just pass that option to Golioth SDK as is, while in case of "pouch peripheral" we switch to "pouch.golioth.dev" (instead of "pouch.golioth.io") when using "coap.golioth.dev" for CoAP: See https://github.com/golioth/bluetooth-gateway/blob/0a9ce0eee28cc69a750ef7a0e9d7182ff99d6d41/gateway/sysbuild.cmake#L52-L55
There was a problem hiding this comment.
Let's add a README that describes the custom sync and scan logic in this app
| #pragma once | ||
|
|
||
| /** | ||
| * Start Bluetooth scanning for devices. |
There was a problem hiding this comment.
Let's describe what criteria this uses to select devices (i.e. the Pouch Service UUID).
There was a problem hiding this comment.
Added more documentation with select criteria. Please check that is fine now.
Some heaer files were missing it. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This allows to reuse core gateway functionality and easily build custom logic around it. Additionally this makes it easy to embed into 3rd party applications, where gateway will be just one of the implemented roles. Move parts of (previous) connect.c functionality to application layer, especially connect/disconnect handlers. Provide APIs: * pouch_gateway_scan_start() * pouch_gateway_scan_stop() that allow to pass control of the Bluetooth connection to the library and then cleanup library resources after being done. When library is done with BT communication, application specific pouch_gateway_bt_finished() is called. Library does not disconnect on error, but instead call pouch_gateway_bt_finished() as well. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This sample provides following custom functionality: * BT scanning is handled by application, with additional filters (Bluetooth device name and RSSI) * sync pouch 2x during each BT connection with 5s delay between syncs; this simulates other BT communication that might happen in application code Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
No description provided.