@@ -57,7 +57,7 @@ static uint8_t ot_plat_ble_msg_buf[PLAT_BLE_MSG_DATA_MAX];
57
57
58
58
static K_SEM_DEFINE (ot_plat_ble_init_semaphore , 0 , 1 ) ;
59
59
static K_SEM_DEFINE (ot_plat_ble_event_semaphore , 0 , K_SEM_MAX_LIMIT );
60
- RING_BUF_DECLARE (ot_plat_ble_ring_buf , CONFIG_OPENTHREAD_BLE_TCAT_RING_BUF_SIZE );
60
+ RING_BUFFER_DECLARE (ot_plat_ble_ring_buf , CONFIG_OPENTHREAD_BLE_TCAT_RING_BUF_SIZE );
61
61
static K_THREAD_DEFINE (ot_plat_ble_tid , CONFIG_OPENTHREAD_BLE_TCAT_THREAD_STACK_SIZE ,
62
62
ot_plat_ble_thread , NULL, NULL, NULL, 5 , 0 , PLAT_BLE_THREAD_DEALY ) ;
63
63
@@ -126,11 +126,11 @@ static bool ot_plat_ble_queue_msg(const uint8_t *aData, uint16_t aLen, int8_t aR
126
126
127
127
len = sizeof (aLen ) + sizeof (aRssi ) + ((aLen <= PLAT_BLE_MSG_DATA_MAX ) ? aLen : 0 );
128
128
129
- if (ring_buf_space_get (& ot_plat_ble_ring_buf ) >= len ) {
130
- ring_buf_put (& ot_plat_ble_ring_buf , (uint8_t * )& aLen , sizeof (aLen ));
131
- ring_buf_put (& ot_plat_ble_ring_buf , & aRssi , sizeof (aRssi ));
129
+ if (ring_buffer_space (& ot_plat_ble_ring_buf ) >= len ) {
130
+ ring_buffer_write (& ot_plat_ble_ring_buf , (uint8_t * )& aLen , sizeof (aLen ));
131
+ ring_buffer_write (& ot_plat_ble_ring_buf , & aRssi , sizeof (aRssi ));
132
132
if (aLen <= PLAT_BLE_MSG_DATA_MAX ) {
133
- ring_buf_put (& ot_plat_ble_ring_buf , aData , aLen );
133
+ ring_buffer_write (& ot_plat_ble_ring_buf , aData , aLen );
134
134
}
135
135
k_sem_give (& ot_plat_ble_event_semaphore );
136
136
} else {
@@ -156,10 +156,10 @@ static void ot_plat_ble_thread(void *unused1, void *unused2, void *unused3)
156
156
157
157
while (1 ) {
158
158
k_sem_take (& ot_plat_ble_event_semaphore , K_FOREVER );
159
- ring_buf_get (& ot_plat_ble_ring_buf , (uint8_t * )& len , sizeof (len ));
160
- ring_buf_get (& ot_plat_ble_ring_buf , & rssi , sizeof (rssi ));
159
+ ring_buffer_read (& ot_plat_ble_ring_buf , (uint8_t * )& len , sizeof (len ));
160
+ ring_buffer_read (& ot_plat_ble_ring_buf , & rssi , sizeof (rssi ));
161
161
if (len <= PLAT_BLE_MSG_DATA_MAX ) {
162
- ring_buf_get (& ot_plat_ble_ring_buf , ot_plat_ble_msg_buf , len );
162
+ ring_buffer_read (& ot_plat_ble_ring_buf , ot_plat_ble_msg_buf , len );
163
163
}
164
164
165
165
openthread_mutex_lock ();
0 commit comments