[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


apache-mynewt-bot commented on pull request #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#issuecomment-618613125


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


apache-mynewt-bot removed a comment on pull request #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#issuecomment-618509262


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] h2zero commented on a change in pull request #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


h2zero commented on a change in pull request #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#discussion_r414052364



##
File path: nimble/host/src/ble_gap.c
##
@@ -1806,15 +1806,40 @@ int
 ble_gap_rx_l2cap_update_req(uint16_t conn_handle,
 struct ble_gap_upd_params *params)
 {
+struct ble_gap_upd_params self_params;
 struct ble_gap_event event;
 int rc;
 
+/* Copy the peer params into the self params to make it easy on the
+ * application.  The application callback will change only the fields which
+ * it finds unsuitable.
+ */
+self_params = *params;
+
 memset(, 0, sizeof event);
 event.type = BLE_GAP_EVENT_L2CAP_UPDATE_REQ;
 event.conn_update_req.conn_handle = conn_handle;
+event.conn_update_req.self_params = _params;
 event.conn_update_req.peer_params = params;
 
 rc = ble_gap_call_conn_event_cb(, conn_handle);
+
+if ((self_params.itvl_min <= self_params.itvl_max)
+ && (self_params.itvl_min >= params->itvl_min)
+ && (self_params.itvl_max <= params->itvl_max)) {
+ params->itvl_max = self_params.itvl_max;
+ params->itvl_min = self_params.itvl_min;
+}
+
+if ((self_params.min_ce_len <= self_params.max_ce_len)

Review comment:
   Yes, I think the app should be able to change the `min/max_ce_len` to 
whatever it wants. 
   That's just my opinion, we'll have to see what @rymanluk thinks.
   
   Also, since you're using the esp32 as well you might be interested in 
[this](https://github.com/espressif/esp-nimble/issues/4) for some insight into 
my opinion.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] zacwbond commented on a change in pull request #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


zacwbond commented on a change in pull request #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#discussion_r414033963



##
File path: nimble/host/src/ble_gap.c
##
@@ -1806,15 +1806,40 @@ int
 ble_gap_rx_l2cap_update_req(uint16_t conn_handle,
 struct ble_gap_upd_params *params)
 {
+struct ble_gap_upd_params self_params;
 struct ble_gap_event event;
 int rc;
 
+/* Copy the peer params into the self params to make it easy on the
+ * application.  The application callback will change only the fields which
+ * it finds unsuitable.
+ */
+self_params = *params;
+
 memset(, 0, sizeof event);
 event.type = BLE_GAP_EVENT_L2CAP_UPDATE_REQ;
 event.conn_update_req.conn_handle = conn_handle;
+event.conn_update_req.self_params = _params;
 event.conn_update_req.peer_params = params;
 
 rc = ble_gap_call_conn_event_cb(, conn_handle);
+
+if ((self_params.itvl_min <= self_params.itvl_max)
+ && (self_params.itvl_min >= params->itvl_min)
+ && (self_params.itvl_max <= params->itvl_max)) {
+ params->itvl_max = self_params.itvl_max;
+ params->itvl_min = self_params.itvl_min;
+}
+
+if ((self_params.min_ce_len <= self_params.max_ce_len)

Review comment:
   I checked in a fix, but realized I might have done the opposite thing to 
what you wanted.  Do you want to allow the callback to change the ce_len to 
whatever it wants, or do you want to prevent it from changing them at all?  I 
did the latter, but I think you may have meant the former.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] h2zero commented on a change in pull request #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


h2zero commented on a change in pull request #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#discussion_r414019801



##
File path: nimble/host/src/ble_gap.c
##
@@ -1806,15 +1806,40 @@ int
 ble_gap_rx_l2cap_update_req(uint16_t conn_handle,
 struct ble_gap_upd_params *params)
 {
+struct ble_gap_upd_params self_params;
 struct ble_gap_event event;
 int rc;
 
+/* Copy the peer params into the self params to make it easy on the
+ * application.  The application callback will change only the fields which
+ * it finds unsuitable.
+ */
+self_params = *params;
+
 memset(, 0, sizeof event);
 event.type = BLE_GAP_EVENT_L2CAP_UPDATE_REQ;
 event.conn_update_req.conn_handle = conn_handle;
+event.conn_update_req.self_params = _params;
 event.conn_update_req.peer_params = params;
 
 rc = ble_gap_call_conn_event_cb(, conn_handle);
+
+if ((self_params.itvl_min <= self_params.itvl_max)
+ && (self_params.itvl_min >= params->itvl_min)
+ && (self_params.itvl_max <= params->itvl_max)) {
+ params->itvl_max = self_params.itvl_max;
+ params->itvl_min = self_params.itvl_min;
+}
+
+if ((self_params.min_ce_len <= self_params.max_ce_len)

Review comment:
   Unless I'm mistaken we probably shouldn't restrict the min/max_ce_len 
values as they are not requested by the peer and actually just initialized 
[here](https://github.com/apache/mynewt-nimble/blob/6ced1dd4ca63e6f0bd2df7dcc558afcc2896f1c2/nimble/host/src/ble_l2cap_sig.c#L414)
 to:
   ```
   params.min_ce_len = BLE_GAP_INITIAL_CONN_MIN_CE_LEN;
   params.max_ce_len = BLE_GAP_INITIAL_CONN_MAX_CE_LEN;
   ```
   before this gets called.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


apache-mynewt-bot commented on issue #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#issuecomment-618509262


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #783: Make ble_gap_rx_l2cap_update_req() behave like ble_gap_rx_param_req()

2020-04-23 Thread GitBox


apache-mynewt-bot removed a comment on issue #783:
URL: https://github.com/apache/mynewt-nimble/pull/783#issuecomment-604091459


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #806: nimble/ll: Some LL fixes, cleaning and improvements

2020-04-23 Thread GitBox


apache-mynewt-bot removed a comment on issue #806:
URL: https://github.com/apache/mynewt-nimble/pull/806#issuecomment-618371590


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/controller/src/ble_ll_hci.c
   
   
   ```diff
   @@ -1183,7 +1184,7 @@
rc = ble_ll_iso_read_tx_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_SET_CIG_PARAM:
   -rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
   +rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_CIS:
rc = ble_ll_iso_create_cis(cmdbuf, len);
   ```
   
   
   
    nimble/controller/src/ble_ll_supp_cmd.c
   
   
   ```diff
   @@ -415,13 +415,13 @@
#endif

#define BLE_LL_SUPP_CMD_OCTET_41\
   -(   \
   -BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2  | \
   -BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC  | \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2  | \
   +BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC  | \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   +)

/* Octet 42 */
#if MYNEWT_VAL(BLE_ISO)
   @@ -444,16 +444,16 @@
#define BLE_SUPP_CMD_LE_TERMINATE_BIG   (0 << 7)
#endif
#define BLE_LL_SUPP_CMD_OCTET_42 \
   -(\
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST | \
   -BLE_SUPP_CMD_LE_CREATE_CIS | \
   -BLE_SUPP_CMD_LE_REMOVE_CIG | \
   -BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ | \
   -BLE_SUPP_CMD_LE_REJECT_CIS_REQ | \
   -BLE_SUPP_CMD_LE_CREATE_BIG | \
   -BLE_SUPP_CMD_LE_CREATE_BIG_TEST| \
   -BLE_SUPP_CMD_LE_TERMINATE_BIG\
   -)
   +(\
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST | \
   +BLE_SUPP_CMD_LE_CREATE_CIS | \
   +BLE_SUPP_CMD_LE_REMOVE_CIG | \
   +BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ | \
   +BLE_SUPP_CMD_LE_REJECT_CIS_REQ | \
   +BLE_SUPP_CMD_LE_CREATE_BIG | \
   +BLE_SUPP_CMD_LE_CREATE_BIG_TEST| \
   +BLE_SUPP_CMD_LE_TERMINATE_BIG\
   +)

/* Octet 43 */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
   @@ -462,9 +462,9 @@
#define BLE_SUPP_CMD_LE_REQUEST_PEER_SCA (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_43\
   -(   \
   -BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   +)

/* Octet 44 */
#if MYNEWT_VAL(BLE_VERSION) >= 52
   @@ -473,13 +473,12 @@
#define BLE_SUPP_CMD_LE_SET_HOST_FEATURE (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_44\
   -(   \
   -BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   +)

/* Defines the array of supported commands */
   -const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] =
   -{
   +const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] = {
BLE_LL_SUPP_CMD_OCTET_0,/* Octet 0 */
0,
0,
   ```
   
   
   
    nimble/include/nimble/hci_common.h
   
   
   ```diff
   @@ -198,15 +198,15 @@
#define BLE_HCI_OCF_LE_RD_BUF_SIZE  (0x0002)
struct ble_hci_le_rd_buf_size_rp {
uint16_t data_len;
   -uint8_t  data_packets;
   +uint8_t data_packets;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_RD_BUF_SIZE_V2(0x0060)
struct ble_hci_le_rd_buf_size_v2_rp {
uint16_t data_len;
   -uint8_t  data_packets;
   +uint8_t data_packets;
uint16_t iso_data_len;
   -uint8_t  iso_data_packets;
   +uint8_t iso_data_packets;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_RD_LOC_SUPP_FEAT (0x0003)
   @@ -1661,17 +1661,17 @@

#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_TRANSFER   (0x18)
struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
   -uint8_t  subev_code;
   -uint8_t  status;
   +uint8_t subev_code;
   +uint8_t status;

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #806: nimble/ll: Some LL fixes, cleaning and improvements

2020-04-23 Thread GitBox


apache-mynewt-bot commented on issue #806:
URL: https://github.com/apache/mynewt-nimble/pull/806#issuecomment-618434827


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/controller/src/ble_ll_hci.c
   
   
   ```diff
   @@ -1183,7 +1184,7 @@
rc = ble_ll_iso_read_tx_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_SET_CIG_PARAM:
   -rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
   +rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_CIS:
rc = ble_ll_iso_create_cis(cmdbuf, len);
   ```
   
   
   
    nimble/controller/src/ble_ll_supp_cmd.c
   
   
   ```diff
   @@ -415,13 +415,13 @@
#endif

#define BLE_LL_SUPP_CMD_OCTET_41\
   -(   \
   -BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2  | \
   -BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC  | \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2  | \
   +BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC  | \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   +)

/* Octet 42 */
#if MYNEWT_VAL(BLE_ISO)
   @@ -444,16 +444,16 @@
#define BLE_SUPP_CMD_LE_TERMINATE_BIG   (0 << 7)
#endif
#define BLE_LL_SUPP_CMD_OCTET_42 \
   -(\
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST | \
   -BLE_SUPP_CMD_LE_CREATE_CIS | \
   -BLE_SUPP_CMD_LE_REMOVE_CIG | \
   -BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ | \
   -BLE_SUPP_CMD_LE_REJECT_CIS_REQ | \
   -BLE_SUPP_CMD_LE_CREATE_BIG | \
   -BLE_SUPP_CMD_LE_CREATE_BIG_TEST| \
   -BLE_SUPP_CMD_LE_TERMINATE_BIG\
   -)
   +(\
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST | \
   +BLE_SUPP_CMD_LE_CREATE_CIS | \
   +BLE_SUPP_CMD_LE_REMOVE_CIG | \
   +BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ | \
   +BLE_SUPP_CMD_LE_REJECT_CIS_REQ | \
   +BLE_SUPP_CMD_LE_CREATE_BIG | \
   +BLE_SUPP_CMD_LE_CREATE_BIG_TEST| \
   +BLE_SUPP_CMD_LE_TERMINATE_BIG\
   +)

/* Octet 43 */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
   @@ -462,9 +462,9 @@
#define BLE_SUPP_CMD_LE_REQUEST_PEER_SCA (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_43\
   -(   \
   -BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   +)

/* Octet 44 */
#if MYNEWT_VAL(BLE_VERSION) >= 52
   @@ -473,13 +473,12 @@
#define BLE_SUPP_CMD_LE_SET_HOST_FEATURE (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_44\
   -(   \
   -BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   +)

/* Defines the array of supported commands */
   -const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] =
   -{
   +const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] = {
BLE_LL_SUPP_CMD_OCTET_0,/* Octet 0 */
0,
0,
   ```
   
   
   
    nimble/include/nimble/hci_common.h
   
   
   ```diff
   @@ -198,15 +198,15 @@
#define BLE_HCI_OCF_LE_RD_BUF_SIZE  (0x0002)
struct ble_hci_le_rd_buf_size_rp {
uint16_t data_len;
   -uint8_t  data_packets;
   +uint8_t data_packets;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_RD_BUF_SIZE_V2(0x0060)
struct ble_hci_le_rd_buf_size_v2_rp {
uint16_t data_len;
   -uint8_t  data_packets;
   +uint8_t data_packets;
uint16_t iso_data_len;
   -uint8_t  iso_data_packets;
   +uint8_t iso_data_packets;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_RD_LOC_SUPP_FEAT (0x0003)
   @@ -1661,17 +1661,17 @@

#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_TRANSFER   (0x18)
struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
   -uint8_t  subev_code;
   -uint8_t  status;
   +uint8_t subev_code;
   +uint8_t status;
uint16_t 

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #806: nimble/ll: Some LL fixes, cleaning and improvements

2020-04-23 Thread GitBox


apache-mynewt-bot commented on issue #806:
URL: https://github.com/apache/mynewt-nimble/pull/806#issuecomment-618371590


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/controller/src/ble_ll_hci.c
   
   
   ```diff
   @@ -1183,7 +1184,7 @@
rc = ble_ll_iso_read_tx_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_SET_CIG_PARAM:
   -rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
   +rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_CIS:
rc = ble_ll_iso_create_cis(cmdbuf, len);
   ```
   
   
   
    nimble/controller/src/ble_ll_supp_cmd.c
   
   
   ```diff
   @@ -415,13 +415,13 @@
#endif

#define BLE_LL_SUPP_CMD_OCTET_41\
   -(   \
   -BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2  | \
   -BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC  | \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2  | \
   +BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC  | \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   +)

/* Octet 42 */
#if MYNEWT_VAL(BLE_ISO)
   @@ -444,16 +444,16 @@
#define BLE_SUPP_CMD_LE_TERMINATE_BIG   (0 << 7)
#endif
#define BLE_LL_SUPP_CMD_OCTET_42 \
   -(\
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST | \
   -BLE_SUPP_CMD_LE_CREATE_CIS | \
   -BLE_SUPP_CMD_LE_REMOVE_CIG | \
   -BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ | \
   -BLE_SUPP_CMD_LE_REJECT_CIS_REQ | \
   -BLE_SUPP_CMD_LE_CREATE_BIG | \
   -BLE_SUPP_CMD_LE_CREATE_BIG_TEST| \
   -BLE_SUPP_CMD_LE_TERMINATE_BIG\
   -)
   +(\
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST | \
   +BLE_SUPP_CMD_LE_CREATE_CIS | \
   +BLE_SUPP_CMD_LE_REMOVE_CIG | \
   +BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ | \
   +BLE_SUPP_CMD_LE_REJECT_CIS_REQ | \
   +BLE_SUPP_CMD_LE_CREATE_BIG | \
   +BLE_SUPP_CMD_LE_CREATE_BIG_TEST| \
   +BLE_SUPP_CMD_LE_TERMINATE_BIG\
   +)

/* Octet 43 */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
   @@ -462,9 +462,9 @@
#define BLE_SUPP_CMD_LE_REQUEST_PEER_SCA (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_43\
   -(   \
   -BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   +)

/* Octet 44 */
#if MYNEWT_VAL(BLE_VERSION) >= 52
   @@ -473,13 +473,12 @@
#define BLE_SUPP_CMD_LE_SET_HOST_FEATURE (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_44\
   -(   \
   -BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   +)

/* Defines the array of supported commands */
   -const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] =
   -{
   +const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] = {
BLE_LL_SUPP_CMD_OCTET_0,/* Octet 0 */
0,
0,
   ```
   
   
   
    nimble/include/nimble/hci_common.h
   
   
   ```diff
   @@ -198,15 +198,15 @@
#define BLE_HCI_OCF_LE_RD_BUF_SIZE  (0x0002)
struct ble_hci_le_rd_buf_size_rp {
uint16_t data_len;
   -uint8_t  data_packets;
   +uint8_t data_packets;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_RD_BUF_SIZE_V2(0x0060)
struct ble_hci_le_rd_buf_size_v2_rp {
uint16_t data_len;
   -uint8_t  data_packets;
   +uint8_t data_packets;
uint16_t iso_data_len;
   -uint8_t  iso_data_packets;
   +uint8_t iso_data_packets;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_RD_LOC_SUPP_FEAT (0x0003)
   @@ -1661,17 +1661,17 @@

#define BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_TRANSFER   (0x18)
struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
   -uint8_t  subev_code;
   -uint8_t  status;
   +uint8_t subev_code;
   +uint8_t status;
uint16_t 

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #806: nimble/ll: Some LL fixes, cleaning and improvements

2020-04-23 Thread GitBox


apache-mynewt-bot removed a comment on issue #806:
URL: https://github.com/apache/mynewt-nimble/pull/806#issuecomment-618084446


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/controller/src/ble_ll_iso.c
   
   
   ```diff
   @@ -93,7 +93,8 @@
return BLE_ERR_UNSUPPORTED;
}

   -int ble_ll_iso_big_create_sync(const uint8_t *cmdbuf, uint8_t len)
   +int
   +ble_ll_iso_big_create_sync(const uint8_t *cmdbuf, uint8_t len)
{
return BLE_ERR_UNSUPPORTED;
}
   ```
   
   
   
    nimble/controller/src/ble_ll_conn_hci.c
   
   
   ```diff
   @@ -1563,7 +1563,7 @@
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
int
ble_ll_conn_req_peer_sca(const uint8_t *cmdbuf, uint8_t len,
   -  uint8_t *rspbuf, uint8_t *rsplen)
   + uint8_t *rspbuf, uint8_t *rsplen)
{
const struct ble_hci_le_request_peer_sca_cp *params = (const void 
*)cmdbuf;
struct ble_ll_conn_sm *connsm;
   ```
   
   
   
    nimble/controller/src/ble_ll_hci.c
   
   
   ```diff
   @@ -1183,7 +1184,7 @@
rc = ble_ll_iso_read_tx_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_SET_CIG_PARAM:
   -rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
   +rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_CIS:
rc = ble_ll_iso_create_cis(cmdbuf, len);
   ```
   
   
   
    nimble/controller/src/ble_ll_supp_cmd.c
   
   
   ```diff
   @@ -415,13 +415,13 @@
#endif

#define BLE_LL_SUPP_CMD_OCTET_41\
   -(   \
   -BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   -BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2 |  \
   -BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC |  \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_PADV_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_PADV_DEFAULT_SYNC_TRANSFER_PARAMS | \
   +BLE_SUPP_CMD_LE_READ_BUF_SIZE_V2 |  \
   +BLE_SUPP_CMD_LE_READ_ISO_TX_SYNC |  \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM   \
   +)

/* Octet 42 */
#if MYNEWT_VAL(BLE_ISO)
   @@ -444,16 +444,16 @@
#define BLE_SUPP_CMD_LE_TERMINATE_BIG (0 << 7)
#endif
#define BLE_LL_SUPP_CMD_OCTET_42\
   -(   \
   -BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST |\
   -BLE_SUPP_CMD_LE_CREATE_CIS |\
   -BLE_SUPP_CMD_LE_REMOVE_CIG |\
   -BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ |\
   -BLE_SUPP_CMD_LE_REJECT_CIS_REQ |\
   -BLE_SUPP_CMD_LE_CREATE_BIG  |   \
   -BLE_SUPP_CMD_LE_CREATE_BIG_TEST |   \
   -BLE_SUPP_CMD_LE_TERMINATE_BIG   \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_CIG_PARAM_TEST |\
   +BLE_SUPP_CMD_LE_CREATE_CIS |\
   +BLE_SUPP_CMD_LE_REMOVE_CIG |\
   +BLE_SUPP_CMD_LE_ACCEPT_CIS_REQ |\
   +BLE_SUPP_CMD_LE_REJECT_CIS_REQ |\
   +BLE_SUPP_CMD_LE_CREATE_BIG  |   \
   +BLE_SUPP_CMD_LE_CREATE_BIG_TEST |   \
   +BLE_SUPP_CMD_LE_TERMINATE_BIG   \
   +)

/* Octet 43 */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_SCA_UPDATE)
   @@ -462,9 +462,9 @@
#define BLE_SUPP_CMD_LE_REQUEST_PEER_SCA (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_43\
   -(   \
   -BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_REQUEST_PEER_SCA  \
   +)

/* Octet 44 */
#if MYNEWT_VAL(BLE_VERSION) >= 52
   @@ -473,13 +473,12 @@
#define BLE_SUPP_CMD_LE_SET_HOST_FEATURE (0 << 0)
#endif
#define BLE_LL_SUPP_CMD_OCTET_44\
   -(   \
   -BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   -)
   +(   \
   +BLE_SUPP_CMD_LE_SET_HOST_FEATURE  \
   +)

/* Defines the array of supported commands */
   -const uint8_t g_ble_ll_supp_cmds[BLE_LL_SUPP_CMD_LEN] =
   -{
   +const uint8_t 

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

2020-04-23 Thread GitBox


apache-mynewt-bot commented on issue #796:
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-618230464


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

2020-04-23 Thread GitBox


apache-mynewt-bot removed a comment on issue #796:
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-618228256


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    apps/central/src/main.c
   
   
   ```diff
   @@ -92,9 +92,11 @@
event->conn_update.status);
}
break;
   -// case BLE_GAP_EVENT_PHY_UPDATE_COMPLETE:
   -// MODLOG_DFLT(INFO,"PHY update complete\n");
   -// break;
   +/*
   +   case BLE_GAP_EVENT_PHY_UPDATE_COMPLETE:
   +   MODLOG_DFLT(INFO,"PHY update complete\n");
   +   break;
   + */
default:
MODLOG_DFLT(INFO,"Connection event type not supported, %d\n",
event->type);
   ```
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] Reynevan94 commented on a change in pull request #796: Apps: central added

2020-04-23 Thread GitBox


Reynevan94 commented on a change in pull request #796:
URL: https://github.com/apache/mynewt-nimble/pull/796#discussion_r413574327



##
File path: apps/central/src/main.c
##
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "sysinit/sysinit.h"
+#include "os/os.h"
+#include "console/console.h"
+#include "host/ble_hs.h"
+#include "host/util/util.h"
+#include "console/console.h"
+#include "log/log.h"
+
+static uint8_t g_own_addr_type;
+uint32_t delay_ms = 2000;
+os_time_t ticks;
+
+static void
+ble_app_set_addr(void)
+{
+ble_addr_t addr;
+int rc;
+
+/* generate new non-resolvable private address */
+rc = ble_hs_id_gen_rnd(0, );
+assert(rc == 0);
+
+/* set generated address */
+rc = ble_hs_id_set_rnd(addr.val);
+assert(rc == 0);
+}
+
+/* scan_event() calls scan(), so forward declaration is required */
+static void scan(void);
+
+/* connection has separate event handler from scan */
+static int
+conn_event(struct ble_gap_event *event, void *arg)
+{
+int rc;
+switch (event->type) {
+case BLE_GAP_EVENT_CONNECT:
+if (event->connect.status == 0) {
+MODLOG_DFLT(INFO,"Connection was fully established\n");
+/* Set PHY for established conection */
+rc = ble_gap_set_prefered_le_phy(event->connect.conn_handle,
+ BLE_GAP_LE_PHY_2M_MASK,
+ BLE_GAP_LE_PHY_2M_MASK,
+ BLE_GAP_LE_PHY_CODED_ANY);
+if (rc == 0) {
+MODLOG_DFLT(INFO, "rx and tx PHYs set to 2M\n");
+} else {
+MODLOG_DFLT(INFO, "failed to set rx and tx PHYs\n");
+}
+ble_gap_terminate(event->connect.conn_handle, 0x13);

Review comment:
   I added this feature, but I couldn't get this event called. Maybe other 
side is configured in a way this change can't be made, so this should be 
checked.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #796: Apps: central added

2020-04-23 Thread GitBox


apache-mynewt-bot commented on issue #796:
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-618228256


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    apps/central/src/main.c
   
   
   ```diff
   @@ -92,9 +92,11 @@
event->conn_update.status);
}
break;
   -// case BLE_GAP_EVENT_PHY_UPDATE_COMPLETE:
   -// MODLOG_DFLT(INFO,"PHY update complete\n");
   -// break;
   +/*
   +   case BLE_GAP_EVENT_PHY_UPDATE_COMPLETE:
   +   MODLOG_DFLT(INFO,"PHY update complete\n");
   +   break;
   + */
default:
MODLOG_DFLT(INFO,"Connection event type not supported, %d\n",
event->type);
   ```
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #796: Apps: central added

2020-04-23 Thread GitBox


apache-mynewt-bot removed a comment on issue #796:
URL: https://github.com/apache/mynewt-nimble/pull/796#issuecomment-615212074


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org