Contenu connexe
Similaire à Port Bluedroid to RTOS (20)
Port Bluedroid to RTOS
- 3. • Protocols
• ATT AVCTP AVDTP BNEP BTM L2CAP
MCAP OBEX RFCOMM SDP SMP
• Profiles
• A2DP AVRCP BIP BPP CTP DI DUN FTP
GAP GATT GOEP HCRP HDP HFP HIDP
HSP ICP LAP MAP OPP PAN PBAP SAP SPP
SYNCH VDP
• Bluedroidの開発は2015-03で停止したが
system/btとして開発が継続 (link)
- 4. GOOD
• Apachie License 2
• BT/BLE dual stack
• 対応しているプロトコル・Profileが多い
• 必要なプロトコル・プロファイルのみのコンフ
ィグできる
• 独自のメモリ管理機構があるのでmallocが無い
OSでも動作
- 10. PORTING RESULT
• ターゲット
• CPU ARM
• OS uITRON4.0互換OS
• コンパイラ ARM Realview
• BLEのみに変更
• ソースコード 9万行
• ROM 約100KB / RAM 約100KB
- 12. sample code
btgatt_srvc_id_t servc_id1 = {
{
{0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xFF, 0xEF, 0x00, 0x00},
0,
},
bt_uuid_t app_uuid1 = {{ 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x19, 0x2a, 0x00, 0x00 }};
bt_uuid_t app_uuid1 = {{ 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x19, 0x2b, 0x00, 0x00 }};
btIf = get_bluetooth_interface();
sGattIf->init(&sGattCallbacks);
btIf->enable();
sGattIf = btIf->get_profile_interface(BT_PROFILE_GATT_ID);
sGattIf->server->register_server(&app_uuid1);
sGattIf->server->add_service(4 , &servc_id1, 24);
sGattIf->server->add_characteristic(4, 40, &app_uuid2, 0x02+0x10, 0x01);
sGattIf->server->start_service(4, 40, 1);
sGattIf->client->set_adv_data(
5 /* client_if */,
0 /* set_scan_resp */,
1 /* include_name */,
0 /* include_txpower */,
0x20 /* min_interval */,
0x100 /* max_interval */,
0 /* appearance */,
0 /* manifactureer_len */,
NULL /* manifacturer_data */,
0 /* service_data_len */,
NULL /* service_data */,
0 /* service_uuid_len */,
NULL /* service_uuid */
);
sGattIf->client->listen(
5 /* server_if */,
1 /* start */
);