AnsweredAssumed Answered

Flight Control Code help

Question asked by John Justice on Jun 7, 2018
Latest reply on Jun 12, 2018 by Matteo Maravita

Can anyone confirm I am reading this code sections below correctly? 

I think all it does is "if ble success" would return a 1 and sets that "1" to the "rc_enable_motor" variable so that the further code can allow the motors to be energized.  For my project, I want the motors to control even when no BLE is connected so I will need to edit around this....

 

in the main.c file it says

static void SendArmingData(void)

{

ARMING_Update(rc_enable_motor);

}

 

Which I believe takes us to the sensor_service.c file which says

tBleStatus ARMING_Update(uint8_t ArmingStatus)

{

tBleStatus ret;

 

uint8_t buff[2+1];

 

STORE_LE_16(buff ,(HAL_GetTick()>>3));

buff[2] = ArmingStatus;

 

ret = aci_gatt_update_char_value(HWServW2STHandle, ArmingCharHandle, 0, 2+1,buff);

 

if (ret != BLE_STATUS_SUCCESS){

if(W2ST_CHECK_CONNECTION(W2ST_CONNECT_STD_ERR)){

BytesToWrite = sprintf((char *)BufferToWrite, "Error Updating ARMING Char\r\n");

Stderr_Update(BufferToWrite,BytesToWrite);

} else {

PRINTF("Error Updating Temp Char\r\n");

}

return BLE_STATUS_ERROR;

}

return BLE_STATUS_SUCCESS;

}

Outcomes