@@ -84,30 +84,6 @@ static void gen_onoff_status(struct bt_mesh_model *model,
8484 struct bt_mesh_msg_ctx * ctx ,
8585 struct os_mbuf * buf );
8686
87- /*
88- * Server Configuration Declaration
89- */
90-
91- static struct bt_mesh_cfg_srv cfg_srv = {
92- .relay = BT_MESH_RELAY_DISABLED ,
93- .beacon = BT_MESH_BEACON_ENABLED ,
94- #if defined(CONFIG_BT_MESH_FRIEND )
95- .frnd = BT_MESH_FRIEND_ENABLED ,
96- #else
97- .frnd = BT_MESH_FRIEND_NOT_SUPPORTED ,
98- #endif
99- #if defined(CONFIG_BT_MESH_GATT_PROXY )
100- .gatt_proxy = BT_MESH_GATT_PROXY_ENABLED ,
101- #else
102- .gatt_proxy = BT_MESH_GATT_PROXY_NOT_SUPPORTED ,
103- #endif
104- .default_ttl = 7 ,
105-
106- /* 3 transmissions with 20ms interval */
107- .net_transmit = BT_MESH_TRANSMIT (2 , 20 ),
108- .relay_retransmit = BT_MESH_TRANSMIT (2 , 20 ),
109- };
110-
11187/*
11288 * Client Configuration Declaration
11389 */
@@ -213,9 +189,9 @@ static const struct bt_mesh_model_op gen_onoff_cli_op[] = {
213189};
214190
215191struct onoff_state {
216- u8_t current ;
217- u8_t previous ;
218- u8_t led_gpio_pin ;
192+ uint8_t current ;
193+ uint8_t previous ;
194+ uint8_t led_gpio_pin ;
219195};
220196
221197/*
@@ -238,7 +214,7 @@ static struct onoff_state onoff_state_arr[] = {
238214 */
239215
240216static struct bt_mesh_model root_models [] = {
241- BT_MESH_MODEL_CFG_SRV ( & cfg_srv ) ,
217+ BT_MESH_MODEL_CFG_SRV ,
242218 BT_MESH_MODEL_CFG_CLI (& cfg_cli ),
243219 BT_MESH_MODEL_HEALTH_SRV (& health_srv , & health_pub ),
244220 BT_MESH_MODEL (BT_MESH_MODEL_ID_GEN_ONOFF_SRV , gen_onoff_srv_op ,
@@ -320,20 +296,20 @@ static const struct bt_mesh_comp comp = {
320296};
321297
322298struct sw {
323- u8_t sw_num ;
324- u8_t onoff_state ;
299+ uint8_t sw_num ;
300+ uint8_t onoff_state ;
325301 struct os_callout button_work ;
326302 struct os_callout button_timer ;
327303};
328304
329305
330- static u8_t button_press_cnt ;
306+ static uint8_t button_press_cnt ;
331307static struct sw sw ;
332308
333- static u8_t trans_id ;
334- static u32_t time , last_time ;
335- static u16_t primary_addr ;
336- static u16_t primary_net_idx ;
309+ static uint8_t trans_id ;
310+ static uint32_t time , last_time ;
311+ static uint16_t primary_addr ;
312+ static uint16_t primary_net_idx ;
337313
338314/*
339315 * Generic OnOff Model Server Message Handlers
@@ -416,15 +392,15 @@ static void gen_onoff_status(struct bt_mesh_model *model,
416392 struct bt_mesh_msg_ctx * ctx ,
417393 struct os_mbuf * buf )
418394{
419- u8_t state ;
395+ uint8_t state ;
420396
421397 state = net_buf_simple_pull_u8 (buf );
422398
423399 BT_INFO ("Node 0x%04x OnOff status from 0x%04x with state 0x%02x" ,
424400 bt_mesh_model_elem (model )-> addr , ctx -> addr , state );
425401}
426402
427- static int output_number (bt_mesh_output_action_t action , u32_t number )
403+ static int output_number (bt_mesh_output_action_t action , uint32_t number )
428404{
429405 BT_INFO ("OOB Number %u" , number );
430406 return 0 ;
@@ -436,7 +412,7 @@ static int output_string(const char *str)
436412 return 0 ;
437413}
438414
439- static void prov_complete (u16_t net_idx , u16_t addr )
415+ static void prov_complete (uint16_t net_idx , uint16_t addr )
440416{
441417 BT_INFO ("provisioning complete for net_idx 0x%04x addr 0x%04x" ,
442418 net_idx , addr );
@@ -449,7 +425,7 @@ static void prov_reset(void)
449425 bt_mesh_prov_enable (BT_MESH_PROV_ADV | BT_MESH_PROV_GATT );
450426}
451427
452- static u8_t dev_uuid [16 ] = MYNEWT_VAL (BLE_MESH_DEV_UUID );
428+ static uint8_t dev_uuid [16 ] = MYNEWT_VAL (BLE_MESH_DEV_UUID );
453429
454430#define BUTTON_DEBOUNCE_DELAY_MS 250
455431
@@ -528,7 +504,7 @@ static void button_pressed_worker(struct os_event *work)
528504 struct bt_mesh_model * mod_cli , * mod_srv ;
529505 struct bt_mesh_model_pub * pub_cli , * pub_srv ;
530506 struct sw * sw = work -> ev_arg ;
531- u8_t sw_idx = sw -> sw_num ;
507+ uint8_t sw_idx = sw -> sw_num ;
532508 int err ;
533509
534510 mod_cli = mod_cli_sw [sw_idx ];
@@ -599,7 +575,7 @@ static const struct bt_mesh_prov prov = {
599575 .reset = prov_reset ,
600576};
601577
602- void init_led (u8_t dev )
578+ void init_led (uint8_t dev )
603579{
604580 hal_gpio_init_out (onoff_state_arr [dev ].led_gpio_pin , 1 );
605581}
0 commit comments