@@ -217,6 +217,27 @@ typedef uint8_t (*lorawan_battery_level_cb_t)(void);
217217 */
218218typedef void (* lorawan_dr_changed_cb_t )(enum lorawan_datarate dr );
219219
220+ /**
221+ * @brief Defines the user's descriptor callback handler function signature.
222+ *
223+ * The use of this callback is optional. When Fragmented Data Block Transport
224+ * is enabled, the application will be notified with the descriptor field present on
225+ * the FragSessionSetupReq command.
226+ *
227+ * @param descriptor Descriptor value given on the FragSessionSetupReq command.
228+ *
229+ * The meaning of Descriptor is application dependent. When doing a FUOTA
230+ * with a binary image, it may represent the version of the firmware
231+ * transported.
232+ *
233+ * @return 0 if successful. This represents, in the case that the descriptor is the firmware
234+ * version, that the end-device is able to receive binary firmware. Otherwise, a negative error code
235+ * (errno.h) indicating the reason for failure. Any negative error code will result in setting
236+ * the Wrong Descriptor status bit mask when sending FragSessionSetupAns to the Network Server.
237+ *
238+ */
239+ typedef int (* transport_descriptor_cb )(uint32_t descriptor );
240+
220241/**
221242 * @brief Register a battery level callback function.
222243 *
@@ -439,6 +460,17 @@ int lorawan_clock_sync_get(uint32_t *gps_time);
439460
440461#ifdef CONFIG_LORAWAN_FRAG_TRANSPORT
441462
463+ /**
464+ * @brief Register a handle descriptor callback function.
465+ *
466+ * Provide to the fragmentation transport service a function to be called
467+ * whenever a FragSessionSetupReq is received and Descriptor field should be
468+ * handled.
469+ *
470+ * @param transport_descriptor_cb Callback for notification.
471+ */
472+ void lorawan_frag_transport_register_descriptor_callback (transport_descriptor_cb cb );
473+
442474/**
443475 * @brief Run Fragmented Data Block Transport service
444476 *
0 commit comments