1111#include <zephyr/bluetooth/conn.h>
1212#include <zephyr/bluetooth/gatt.h>
1313
14- #include <pouch/transport/ble_gatt /common/packetizer.h>
14+ #include <pouch/transport/gatt /common/packetizer.h>
1515
1616#include <pouch_gateway/bt/connect.h>
1717#include <pouch_gateway/types.h>
@@ -24,25 +24,25 @@ static void write_response_cb(struct bt_conn *conn,
2424 uint8_t err ,
2525 struct bt_gatt_write_params * params );
2626
27- static enum golioth_ble_gatt_packetizer_result downlink_packet_fill_cb (void * dst ,
28- size_t * dst_len ,
29- void * user_arg )
27+ static enum pouch_gatt_packetizer_result downlink_packet_fill_cb (void * dst ,
28+ size_t * dst_len ,
29+ void * user_arg )
3030{
3131 bool last = false;
3232
3333 int ret = pouch_gateway_downlink_get_data (user_arg , dst , dst_len , & last );
3434 if (- EAGAIN == ret )
3535 {
3636 LOG_DBG ("Awaiting additional downlink data from cloud" );
37- return GOLIOTH_BLE_GATT_PACKETIZER_MORE_DATA ;
37+ return POUCH_GATT_PACKETIZER_MORE_DATA ;
3838 }
3939 if (0 > ret )
4040 {
4141 * dst_len = 0 ;
42- return GOLIOTH_BLE_GATT_PACKETIZER_ERROR ;
42+ return POUCH_GATT_PACKETIZER_ERROR ;
4343 }
4444
45- return last ? GOLIOTH_BLE_GATT_PACKETIZER_NO_MORE_DATA : GOLIOTH_BLE_GATT_PACKETIZER_MORE_DATA ;
45+ return last ? POUCH_GATT_PACKETIZER_NO_MORE_DATA : POUCH_GATT_PACKETIZER_MORE_DATA ;
4646}
4747
4848static int write_downlink_characteristic (struct bt_conn * conn )
@@ -59,17 +59,17 @@ static int write_downlink_characteristic(struct bt_conn *conn)
5959 }
6060
6161 size_t len = mtu - POUCH_GATEWAY_BT_ATT_OVERHEAD ;
62- enum golioth_ble_gatt_packetizer_result ret =
63- golioth_ble_gatt_packetizer_get (node -> packetizer , node -> downlink_scratch , & len );
62+ enum pouch_gatt_packetizer_result ret =
63+ pouch_gatt_packetizer_get (node -> packetizer , node -> downlink_scratch , & len );
6464
65- if (GOLIOTH_BLE_GATT_PACKETIZER_ERROR == ret )
65+ if (POUCH_GATT_PACKETIZER_ERROR == ret )
6666 {
67- ret = golioth_ble_gatt_packetizer_error (node -> packetizer );
67+ ret = pouch_gatt_packetizer_error (node -> packetizer );
6868 LOG_ERR ("Error getting downlink data %d" , ret );
6969 return ret ;
7070 }
7171
72- if (GOLIOTH_BLE_GATT_PACKETIZER_EMPTY_PAYLOAD == ret )
72+ if (POUCH_GATT_PACKETIZER_EMPTY_PAYLOAD == ret )
7373 {
7474 LOG_DBG ("No downlink data available" );
7575 return - ENODATA ;
@@ -102,7 +102,7 @@ static void write_response_cb(struct bt_conn *conn,
102102 if (err )
103103 {
104104 pouch_gateway_downlink_abort (node -> downlink_ctx );
105- golioth_ble_gatt_packetizer_finish (node -> packetizer );
105+ pouch_gatt_packetizer_finish (node -> packetizer );
106106
107107 pouch_gateway_bt_finished (conn );
108108 return ;
@@ -111,7 +111,7 @@ static void write_response_cb(struct bt_conn *conn,
111111 if (pouch_gateway_downlink_is_complete (node -> downlink_ctx ))
112112 {
113113 pouch_gateway_downlink_finish (node -> downlink_ctx );
114- golioth_ble_gatt_packetizer_finish (node -> packetizer );
114+ pouch_gatt_packetizer_finish (node -> packetizer );
115115
116116 pouch_gateway_bt_finished (conn );
117117 }
@@ -121,7 +121,7 @@ static void write_response_cb(struct bt_conn *conn,
121121 if (0 != ret && - ENODATA != ret )
122122 {
123123 pouch_gateway_downlink_abort (node -> downlink_ctx );
124- golioth_ble_gatt_packetizer_finish (node -> packetizer );
124+ pouch_gatt_packetizer_finish (node -> packetizer );
125125
126126 pouch_gateway_bt_finished (conn );
127127 }
@@ -138,7 +138,7 @@ static void downlink_data_available(void *arg)
138138 if (0 != ret )
139139 {
140140 pouch_gateway_downlink_abort (node -> downlink_ctx );
141- golioth_ble_gatt_packetizer_finish (node -> packetizer );
141+ pouch_gatt_packetizer_finish (node -> packetizer );
142142
143143 pouch_gateway_bt_finished (conn );
144144 }
@@ -169,7 +169,7 @@ struct pouch_gateway_downlink_context *pouch_gateway_downlink_start(struct bt_co
169169
170170 node -> downlink_ctx = pouch_gateway_downlink_init (downlink_data_available , conn );
171171 node -> packetizer =
172- golioth_ble_gatt_packetizer_start_callback (downlink_packet_fill_cb , node -> downlink_ctx );
172+ pouch_gatt_packetizer_start_callback (downlink_packet_fill_cb , node -> downlink_ctx );
173173
174174 return node -> downlink_ctx ;
175175}
0 commit comments