Skip to content

Commit 648b583

Browse files
sophiekovalevskycarlescufi
authored andcommitted
samples: subsys: lorawan: callback registration for handle descriptor
include the use of callback registration to handle descriptor whenever `FragSessionSetupReq` is sent from fuota server. Signed-off-by: Kiara Navarro <[email protected]>
1 parent 6b2a476 commit 648b583

File tree

1 file changed

+14
-0
lines changed
  • samples/subsys/lorawan/fuota/src

1 file changed

+14
-0
lines changed

samples/subsys/lorawan/fuota/src/main.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ static void datarate_changed(enum lorawan_datarate dr)
4141
LOG_INF("New Datarate: DR %d, Max Payload %d", dr, max_size);
4242
}
4343

44+
int descriptor_cb(uint32_t descriptor)
45+
{
46+
/*
47+
* In an actual application the firmware may be able to handle
48+
* the descriptor field
49+
*/
50+
51+
LOG_INF("Received descriptor %u", descriptor);
52+
53+
return 0;
54+
}
55+
4456
static void fuota_finished(void)
4557
{
4658
LOG_INF("FUOTA finished. Reset device to apply firmware upgrade.");
@@ -114,6 +126,8 @@ int main(void)
114126
*/
115127
lorawan_frag_transport_run(fuota_finished);
116128

129+
lorawan_frag_transport_register_descriptor_callback(descriptor_cb);
130+
117131
/*
118132
* Regular uplinks are required to open downlink slots in class A for
119133
* FUOTA setup by the server.

0 commit comments

Comments
 (0)