Behaviour:
- Bluefruit the feater (nRF82832)
- Bluetooth BLE
- Implementation of Fitness Machine Service (0x1826)
- What is correct : all characteristics notified to the client
- What is wrong : the implementation of the flow char of control point characteristic (0x2AD9)
I think now i understood the concept of control point.
I receive a write from the client into it and i try to answer with an indication.
But the client don't continue the configuration of the control point.
I think it should write 04 to set the resistance level, but it didn't
I give you the sequence diagram beetween client and server.
Maybe you can tell me what is wrong
Thank you
Vincent
Implementation of Fitness Machine Control Point
Specification : Fitness Machine Service (0x1826)
Zwift(Client) HomeTrainer(Server) Meaning
FTMS.CtlPt(0x2AD9) write(7) Start or Resume a training session
------------------------------------------------------------------>
FTMS.CtlPt(0x2AD9) write(7) Start or Resume a training session
------------------------------------------------------------------>
FTMS.CtlPt(0x2AD9) indicate(0x8001) Reply: OpCode=0x80 and ResultCode=0x01
<------------------------------------------------------------------
<------------------------------------------------------------------
FTMS.CtlPt(0x2AD9) write(0) Request Control: initiate the procedude to request the control
------------------------------------------------------------------> of the fitness machine
FTMS.CtlPt(0x2AD9) indicate(0x8001) Reply: OpCode=0x80 and ResultCode=0x01
<------------------------------------------------------------------
<------------------------------------------------------------------
Remarques:
1- In the server software the source is the following:
call back OnWrite (characteristic FTMS control point (2AD9):
indicate16 (0x8001) //renvoit 2 octets 0x80 and 0x01
indicate16 (0x8001) //renvoit 2 octets 0x80 and 0x01
2-I tried to indicate 0x0180, but without any success
3- The structure to indicate to the client is (in my opinion) the following:
3- The structure to indicate to the client is (in my opinion) the following:
struct
{ OPCODE: uint8 //0x80 (cf specification p 50/78)
RESULTCODE: uint8 //0X01=SUCCESS
}
{ OPCODE: uint8 //0x80 (cf specification p 50/78)
RESULTCODE: uint8 //0X01=SUCCESS
}
4 - the initialisation of the control point is the following:
//control point pour le controle de la resistance par zwift
m_ControlPoint.setProperties(CHR_PROPS_NOTIFY |CHR_PROPS_WRITE |CHR_PROPS_INDICATE |CHR_PROPS_READ );
m_ControlPoint.setPermission(SECMODE_OPEN, SECMODE_OPEN);
m_ControlPoint.setWriteCallback(fctWriteCallback);
m_ControlPoint.setCccdWriteCallback(fctCCCdCallback); // Optionally capture CCCD updates ?????
m_ControlPoint.setFixedLen(2);
m_ControlPoint.setProperties(CHR_PROPS_NOTIFY |CHR_PROPS_WRITE |CHR_PROPS_INDICATE |CHR_PROPS_READ );
m_ControlPoint.setPermission(SECMODE_OPEN, SECMODE_OPEN);
m_ControlPoint.setWriteCallback(fctWriteCallback);
m_ControlPoint.setCccdWriteCallback(fctCCCdCallback); // Optionally capture CCCD updates ?????
m_ControlPoint.setFixedLen(2);