X-Git-Url: https://git.karo-electronics.de/?p=oswald.git;a=blobdiff_plain;f=metawatch%2Fbt_l2cap.c;fp=metawatch%2Fbt_l2cap.c;h=1a7c686a2592a852672d13d1431ec7d172f6da2d;hp=68015efdae1374ecc4be6971148f9317ce69dbf8;hb=3e320aaa4175a0ed469581f1dea2eac35b390878;hpb=ac20c9d8b06609636166c7f3fa38f97561a21af6 diff --git a/metawatch/bt_l2cap.c b/metawatch/bt_l2cap.c index 68015ef..1a7c686 100644 --- a/metawatch/bt_l2cap.c +++ b/metawatch/bt_l2cap.c @@ -224,7 +224,8 @@ void bt_l2cap_handle_connection_request(const uint16_t handle, const uint8_t ide { bt_l2cap_conn_resp_t resp; - if (_l2cap_con.cstate == BT_L2CAP_CON_IDLE) { + // for now we only support one connection, only on PSM 0x1001 + if (_l2cap_con.cstate == BT_L2CAP_CON_IDLE && PSM == 0x1001) { bt_l2cap_conf_req_t req; _l2cap_con.cstate = BT_L2CAP_CON_CONNECTED; @@ -258,6 +259,12 @@ void bt_l2cap_handle_connection_request(const uint16_t handle, const uint8_t ide req.odat = _l2cap_con.locMTU; bt_acl_send(handle, PB_FIRST_FLUSHABLE, BC_NO_BROADCAST, L2CAP_CID_SIGNALING, sizeof(bt_l2cap_conf_req_t), &req); + + // max_interval Mandatory Range: 0x0006 to 0x0540 + // min_interval Mandatory Range: 0x0006 to 0x0540 + // sniff_attempt Mandatory Range for Controller: 1 to Tsniff/2 + // sniff_timeout Mandatory Range for Controller: 0 to 0x0028 + bt_hci_set_sniff_mode(handle, 0x10, 0x06, 0x20, 0x10); } else { resp.resp = CONNECTION_RESPONSE; resp.ident = ident;