From: hcj <1224667075@qq.com> Date: Tue, 20 Aug 2024 03:11:38 +0000 (+0800) Subject: pabp服务添加 X-Git-Tag: release_V1.2.70_20241020_135402~609^2~14 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=cb8c34acd008627b15cc740dd3c60aebdbf99c83;p=mirrors%2FFD230.git pabp服务添加 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/Bluetooyhpabpserver.h b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/Bluetooyhpabpserver.h index 0af43bc3c..e6de15aed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/Bluetooyhpabpserver.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/Bluetooyhpabpserver.h @@ -15,11 +15,11 @@ void uapi_pbap_pce_reg_callback(void); void uapi_pbap_cmd_start_client(void); void uapi_pbap_cmd_pull_phonebook(void); -void uapi_pbap_cmd_pull_vcard_listing(void); +void uapi_pbap_cmd_pull_vcard_listing(unsigned char *tell); void uapi_pbap_cmd_pull_vcard_entry(td_char *vcf_name); -#endif /* SAMPLE_PBAP_SERVICE_H */ #ifdef __cplusplus } +#endif #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index b00f97d17..20a2f857f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -179,7 +179,7 @@ static int bluetooth_init_all(void) // BtInitCallBacksEx(); //BLE // BtInitGatts(); //BLE - //uapi_pbap_pce_reg_callback(); + uapi_pbap_pce_reg_callback(); // BtInitSpp(); BtA2dpInit(); @@ -1395,6 +1395,9 @@ static void BtA2dpSnkConnectStateChangedCb(bd_addr_t *bd_addr, int conn_state) { SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0); + if(pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTING || + pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTED) + uapi_pbap_cmd_start_client(); // if(conn_state==PROFILE_STATE_CONNECTED) // { // if(pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTED) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp index 5d057e725..ddffb93bf 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp @@ -22,6 +22,8 @@ #include "bts_spp.h" #include "osal_task.h" #include "bleService.h" +#include "BluetoothModel.h" +#include "CallerLogModel.h" #ifdef __cplusplus extern "C" { @@ -53,7 +55,11 @@ static void sample_pbap_print_addr(const bd_addr_t *bd_addr) static void sample_pbap_conn_state(const bd_addr_t *bd_addr, profile_connect_state_t state) { sample_pbap_print_addr(bd_addr); - printf("%d\n", state); + printf("sample_pbap_conn_state %d\n", state); + if(state==PROFILE_STATE_CONNECTED) + { + uapi_pbap_cmd_pull_phonebook(); + } return; } //接收数据回调 @@ -62,6 +68,13 @@ static void sample_pbap_receive_data(const bd_addr_t *bd_addr, const uint8_t* da sample_pbap_print_addr(bd_addr); printf("receive %d bytes(%s)\n", len, data); + if(strstr((char*)data,"vcard-listing.dtd")) + { + char * name_str=strstr((char*)data,"name"); + char *name_=strtok(name_str,"\""); + name_=strtok(NULL,"\""); + OHOS:: CallerLogModel::GetInstance()->Setphonebname(name_,strlen(name_)); + } return; } @@ -132,7 +145,7 @@ void uapi_pbap_pce_reg_callback(void) sample_pbap_handle_error_code, }; ret = (errcode_t)pbap_pce_register_callbacks(&callbacks); - printf("ret=0x%x\n", ret); + printf("uapi_pbap_pce_reg_callback ret=0x%x\n", ret); } @@ -143,7 +156,7 @@ static int32_t sample_pbap_connect_task_body(const void *bd_addr) if (result != ERRCODE_BT_SUCCESS) { printf("Connect to PBAP service failed\n"); } - printf("[Line: %d] finish, result: 0x%x!\n", __LINE__, result); + printf("sample_pbap_connect_task_body [Line: %d] finish, result: 0x%x!\n", __LINE__, result); return 0; } @@ -174,7 +187,7 @@ static void sample_pbap_create_conn_task(const bd_addr_t *bd_addr) // if (!sample_pbap_is_null_pointer((uint16_t)sample_mode, 0)) { // bd_addr = sample_pbap_parse_addr(params[1]); bd_addr_t bdaddr={0}; - get_phone_addr(&bdaddr); + OHOS::uapi_get_br_address(&bdaddr); // } sample_pbap_create_conn_task((const bd_addr_t*)&bdaddr); } @@ -182,7 +195,7 @@ static void sample_pbap_create_conn_task(const bd_addr_t *bd_addr) void uapi_pbap_cmd_stop_client() { bd_addr_t bdaddr={0}; - get_phone_addr(&bdaddr); + OHOS::uapi_get_br_address(&bdaddr); uint32_t ret = (uint32_t)pbap_pce_disconnect(&bdaddr); printf("[Line: %d] finish, ret: %u\n", __LINE__, ret); @@ -306,7 +319,7 @@ void uapi_pbap_cmd_pull_phonebook() uint8_t vcf=PBAP_VCF_PB;//写死 电话簿 uint16_t max_list_count=0xFFFF;//最大数量 uint16_t list_offset=0; - uint8_t format=0;//编码格式 + uint8_t format=1;//编码格式 if (!wstp_pbap_check_param_valid(folder, vcf, max_list_count, list_offset, format)) { printf("pbap param invalid\n"); @@ -443,7 +456,7 @@ static bool sample_pbap_set_vcard_listing_name(bd_addr_t* bd_addr, uint8_t folde } /* get phone vCard-Listing */ -void uapi_pbap_cmd_pull_vcard_listing() +void uapi_pbap_cmd_pull_vcard_listing(unsigned char *tell) { uint8_t folder=1; uint8_t vcf=PBAP_VCF_PB; @@ -475,8 +488,8 @@ void uapi_pbap_cmd_pull_vcard_listing() } (void)memset_s(thr_par->name, PBAP_APP_FOLDER_MAXLENGTH, 0, PBAP_APP_FOLDER_MAXLENGTH); - thr_par->search_property=PBAP_PROPERTY_MASK_TEL; - thr_par->search_value=(unsigned char*)"15111454038"; + thr_par->search_property=PBAP_SEARCH_PROPERTY_NUMBER; + thr_par->search_value=tell; thr_par->max_list_count = max_list_count; thr_par->list_offset = list_offset; /* index = 5 */ /* 0:索引序 1:字典序 */ @@ -599,9 +612,9 @@ void uapi_pbap_cmd_pull_vcard_entry(td_char *vcf_name) { printf("uapi_pbap_cmd_pull_vcard_entry: %s\r\n",vcf_name); bd_addr_t bdaddr={0}; - get_phone_addr(&bdaddr); + OHOS::uapi_get_br_address(&bdaddr); - uint8_t format=0; + uint8_t format=1; uint8_t vcf=PBAP_VCF_PB; uint8_t folder=1; if (!wstp_pbap_check_param_valid(folder, vcf, 0, 0, format)) { @@ -700,7 +713,7 @@ static void sample_pbap_cmd_pull_vcard_entry(const char **params, int32_t params { bd_addr_t bdaddr={0}; - get_phone_addr(&bdaddr); + OHOS::uapi_get_br_address(&bdaddr); if (pbap_pce_get_device_connect_state(&bdaddr) != PROFILE_STATE_CONNECTED) { printf("No PBAP connection selected!\n"); @@ -714,7 +727,7 @@ static void sample_pbap_cmd_pull_vcard_entry(const char **params, int32_t params void uapi_pbap_amd_get_conn_state(void) { bd_addr_t bdaddr={0}; - get_phone_addr(&bdaddr); + OHOS::uapi_get_br_address(&bdaddr); uint32_t result = (uint32_t)pbap_pce_get_device_connect_state(&bdaddr); printf("[Line: %d] finish, conn state: 0x%x\n", __LINE__, result); @@ -766,3 +779,4 @@ typedef struct { #ifdef __cplusplus } #endif + diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h b/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h index b85d61d3a..364ad57cd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h @@ -54,9 +54,24 @@ typedef enum { CallSourcePhone, CallSourceCat1, } CallSource; + + void InitPhoneService(); static CallerLogModel *GetInstance(void); + std::string Getphonename(void) + { + return call_name; + } + + void Setphonebname(char *name,uint8_t name_len) + { + call_name.clear(); + call_name.append(reinterpret_cast(name), name_len); + + //printf("%s\r\n",call_name.c_str()); + } + std::string GetPhoneNumber(void); void SetoperateNumber(const char *number, char number_len); @@ -103,6 +118,7 @@ private: std::string timers; // 时间显示 std::string callDuration; // 通话时长 std::string phoneNumber; // 电话号码 + std ::string call_name; bool mulitplePhoneStatus{false}; // 判断是否多路通话界面 bool waitingStatus{false}; // 判断是否等待提醒界面 bool volumeStatus{false}; // 判断是否音量界面 diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp index 4f4d2301b..0fae7f624 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -59,7 +59,7 @@ static void SetPriorityNumber() { time_t seconds; time(&seconds); - + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSourcePhone); // 接听和挂起状态需要持续显示通话计时 @@ -101,6 +101,7 @@ void StatusReset() CallerLogModel::GetInstance()->SetCallStatus(false); CallerLogModel::GetInstance()->SetWaitingStatus(false); DisableCallingTimer(); + CallerLogModel::GetInstance()->Setphonebname("0",0); // If the call is handling in the notification, the slice is not switched if (!CallerLogModel::GetInstance()->GetNotifyFlag()) { NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_PHONE); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h index fd39f5201..bf6af48d8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h @@ -23,6 +23,7 @@ public: UIViewGroup *CreateUIViewGroup(); static CallerDisplayView *GetInstance(); + void updataCallingname(); private: bool InitAddOnclickevent(void); bool InitImageViewDisplay(void); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h index c2f80ab42..9f83efe41 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h @@ -31,6 +31,7 @@ public: UILabel *GetCallingDurationLabel(); void showdial(bool); void text_updata_buf(const char *buf); + void updataCallingname(void); private: bool InitAddOnclickevent(void); bool InitImageViewDisplay(void); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp index a8ebfd9ac..812153a1d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp @@ -137,6 +137,16 @@ bool CallerDisplayView::InitImageViewDisplay() return true; } +void CallerDisplayView::updataCallingname(void) +{ + if(CallerLogModel::GetInstance()->Getphonename().length()>5) + { + callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str()); + } +} + + + bool CallerDisplayView::InitUILabelDisplay() { callerDisplay = new UILabel(); @@ -156,7 +166,7 @@ bool CallerDisplayView::InitUILabelDisplay() { callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); } - + updataCallingname(); callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER); callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); callerDisplay->SetTextColor(Color::White()); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp index 64884b14f..bce2d1657 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp @@ -139,6 +139,14 @@ UILabel *CallingView::GetCallingDurationLabel() return callDuration; } +void CallingView::updataCallingname(void) +{ + if(CallerLogModel::GetInstance()->Getphonename().length()>5) + { + callerDisplay->SetText(CallerLogModel::GetInstance()->Getphonename().c_str()); + } +} + bool CallingView::InitImageViewDisplay() { imageMicrophone = new UIImageView(); @@ -245,6 +253,8 @@ bool CallingView::InitUILabelDisplay() { callerDisplay->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); } + updataCallingname(); + callerDisplay->SetAlign(TEXT_ALIGNMENT_CENTER); callerDisplay->SetFont(DEFAULT_VECTOR_FONT_FILENAME, LABEL_DISPLAY_FONE_SIZE); diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneServiceC.h b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneServiceC.h index 458fbb477..5a5639b4e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneServiceC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneServiceC.h @@ -16,7 +16,7 @@ int uapi_hfp_disconnect_(void); int uapi_hfp_connect_(void); - +int uapi_hfp_fail_cbk(int32_t errcode); #ifdef __cplusplus } #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index 584f81954..7ea6e7cdc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -31,6 +31,7 @@ #include "notification_manager.h" #include "CallerLogModel.h" #include "custom_utils.h" +#include "Bluetooyhpabpserver.h" #ifdef __cplusplus extern "C" { #endif @@ -603,6 +604,7 @@ static void ConnStateChanged(const bd_addr_t *bdAddr, profile_connect_state_t st WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connected"); BtConnectedPro(bdAddr); SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); + uapi_pbap_cmd_start_client(); //SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0); break; case PROFILE_STATE_DISCONNECTING: // 蓝牙连接断连 @@ -1415,6 +1417,7 @@ static void CallStateChanged(const bd_addr_t *bdAddr, const hfp_hf_calls_info_t SetCompleteCallFlag(call); CatCallStateChangedInfo(bdAddr, call); CallAudioHandle(call); + uapi_pbap_cmd_pull_vcard_listing((unsigned char *)call->number); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "CallStateChanged state:%d", call->state); switch (call->state) { @@ -1927,6 +1930,15 @@ int uapi_hfp_connect_(void) ret = hfp_hf_connect(&bdaddr); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[uapi_hfp_connect] ret:%X", ret); } + + if(ret!=ERRCODE_SUCC) + { + uint8_t br_cmd_code[5]={0}; + br_cmd_code[0]=BR_HFP_CONNECT_FAIL; + memcpy_s(&br_cmd_code[1],4,&ret,4); + + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_BR_CONNECT,br_cmd_code,sizeof(uint8_t)*5); + } @@ -1978,6 +1990,16 @@ int uapi_hfp_disconnect() } +int uapi_hfp_fail_cbk(int32_t errcode) +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%X", errcode); + + return 0; +} + + + + #ifdef __cplusplus } diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index d9ab47984..84872f223 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -383,23 +383,31 @@ void svr_pair_result_cbt_cb(uint16_t conn_id, const bd_addr_t *addr, errcode_t s }else{ - bd_addr_t bdaddr={0}; - uapi_get_br_address(&bdaddr); - if(false==(bt_is_acl_connected(&bdaddr))) + if(get_br_is_pair()) { - if(cm_get_A2DP_switch() || cm_get_HFP_switch()) + bd_addr_t bdaddr={0}; + uapi_get_br_address(&bdaddr); + if(false==(bt_is_acl_connected(&bdaddr))) { - int ret=gap_reconnect_media_device(&bdaddr); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_reconnect_media_device!!! %X\r\n",ret); + if(cm_get_A2DP_switch() || cm_get_HFP_switch()) + { + int ret=gap_reconnect_media_device(&bdaddr); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_reconnect_media_device!!! %X\r\n",ret); + } + // if(cm_get_A2DP_switch() || cm_get_HFP_switch()) + // uapi_a2dp_snk_connect(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_reconnect_media_device!!! \r\n"); + } - - } - else - { - if(cm_get_A2DP_switch() || cm_get_HFP_switch()) - uapi_a2dp_snk_connect(); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_a2dp_snk_connect!!! \r\n"); + else + { + if(cm_get_A2DP_switch() || cm_get_HFP_switch()) + uapi_a2dp_snk_connect(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_a2dp_snk_connect!!! \r\n"); + } + } + // int ret = gap_connect_remote_device(addr); // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_connect_remote_device!!! %X\r\n",ret); diff --git a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c index b35c2ea30..33c20a37f 100644 --- a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c +++ b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c @@ -85,6 +85,7 @@ static void custom_cmd_service_check_task(void const *arg) custom_cmd_cmd_t mail; uint32_t msgsize = (uint32_t)sizeof(custom_cmd_cmd_t); custom_cmd_service_running_stat = true; + int code=0; while (1) { @@ -222,6 +223,11 @@ static void custom_cmd_service_check_task(void const *arg) case BR_RECONNECT: uapi_reconnect_(); break; + case BR_HFP_CONNECT_FAIL: + + memcpy_s(&code,4,&mail.data[1],4); + uapi_hfp_fail_cbk(code); + break; default: break; } diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 2349a7e42..d62487dc2 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -213,6 +213,7 @@ typedef enum { BR_A2DP_CONNECT, BR_A2DP_DISCONNECT, BR_RECONNECT, + BR_HFP_CONNECT_FAIL, } CUSTOM_CMD_MSG_BR_CONNECT_TYPE; diff --git a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c index 14871c94f..0ec208d97 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils_at_cmd.c @@ -906,7 +906,6 @@ static uint32_t custom_get_aging_data(uint8_t *para, uint32_t paraLen, char *str uint8_t aging_data[4] = {0}; uapi_get_file_data("user/userdata/aging_test.bin",aging_data,4); - wstp_print("aging_test fail_num[%d], display_error_num[%d] ,microhone_error_num[%d] ,ppg_error_num[%d] \n",aging_data[0],aging_data[1],aging_data[2],aging_data[3]); return ERRCODE_SUCC; } @@ -1023,7 +1022,7 @@ static uint32_t PBAP_LS(uint8_t *para, uint32_t paraLen, char *strCommonCmd) } #ifdef FD230 - uapi_pbap_cmd_pull_vcard_listing(); + uapi_pbap_cmd_pull_vcard_listing((unsigned char *)argv[0]); #endif return ERRCODE_SUCC; } @@ -1070,7 +1069,11 @@ static uint32_t BLE_TEST(uint8_t *para, uint32_t paraLen, char *strCommonCmd) case 7: uapi_ble_disconnect_device(); break; - + case 8: + br_adv_start(atoi( (char *)argv[1])); + case 9: + br_adv_stop(); + break; default: break; }