Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///**
- // ****************************************************************************************
- // * @brief Send Connect request to GAPM task.
- // *
- // * @param[in] indx Peer device's index in discovered devices list.
- // *
- // * @return void.
- // ****************************************************************************************
- // */
- void app_connect(unsigned char indx)
- {
- struct gapm_start_connection_cmd *msg;
- if (app_env.devices[indx].free == true)
- {
- return;
- }
- msg =
- (struct gapm_start_connection_cmd *)BleMsgAlloc
- (
- GAPM_START_CONNECTION_CMD, TASK_GAPM,
- TASK_GTL, sizeof(struct gapm_start_connection_cmd)
- );
- msg->nb_peers = 1;
- memcpy
- (
- (void *)&msg->peers[0].addr, (void *)&app_env.devices[indx].adv_addr.addr,
- BD_ADDR_LEN
- );
- msg->con_intv_min = (6);
- msg->con_intv_max = (200);
- msg->ce_len_min = 0x0;
- msg->ce_len_max = (0x5);
- msg->con_latency = (BLE_LATENCY);
- msg->op.addr_src = GAPM_PUBLIC_ADDR;
- msg->peers[0].addr_type = GAPM_PUBLIC_ADDR;
- msg->superv_to = (1000); // 0x7D0;
- msg->scan_interval = (0x180);
- msg->scan_window = (0x160);
- msg->op.code = GAPM_CONNECTION_DIRECT;
- BleSendMsg((void *)msg);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement