You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by gi...@git.apache.org on 2017/09/28 10:47:46 UTC

[GitHub] rymanluk commented on a change in pull request #583: Mesh fixes and improvements

rymanluk commented on a change in pull request #583: Mesh fixes and improvements
URL: https://github.com/apache/mynewt-core/pull/583#discussion_r141574897
 
 

 ##########
 File path: apps/blemesh/src/main.c
 ##########
 @@ -52,7 +54,83 @@ static struct bt_mesh_cfg cfg_srv = {
     .relay_retransmit = BT_MESH_TRANSMIT(2, 20),
 };
 
+static int
+fault_get_cur(struct bt_mesh_model *model,
+              uint8_t *test_id,
+              uint16_t *company_id,
+              uint8_t *faults,
+              uint8_t *fault_count)
+{
+    uint8_t reg_faults[24] = { [0 ... 23] = 0xff };
+
+    console_printf("fault_get_cur() has_reg_fault %u\n", has_reg_fault);
+
+    *test_id = 0x00;
+    *company_id = CID_VENDOR;
+
+    *fault_count = min(*fault_count, sizeof(reg_faults));
+    memcpy(faults, reg_faults, *fault_count);
+
+    return 0;
+}
+
+static int
+fault_get_reg(struct bt_mesh_model *model,
+              uint16_t company_id,
+              uint8_t *test_id,
+              uint8_t *faults,
+              uint8_t *fault_count)
+{
+    if (company_id != CID_VENDOR) {
+        return -BLE_HS_EINVAL;
+    }
+
+    console_printf("fault_get_reg() has_reg_fault %u\n", has_reg_fault);
+
+    *test_id = 0x00;
+
+    if (has_reg_fault) {
+        uint8_t reg_faults[24] = { [0 ... 23] = 0xff };
 
 Review comment:
   let's keep Mynewt coding style and declare it on beginning of the function
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services