NGA Command_Response Protocol

NGA Protocol Format:

<STX><CLenL><CLenH><Command_Body/Response_Body/Notification/Output Body/Input Body>…<LRC> <CheckSum><ETX> 

 When trying to make sense of NGA commands and responses, the first thing to recognize is that the first three bytes (<STX><CLenL><CLenH>) and the last three bytes (<LRC> <CheckSum><ETX>) are administrative and can be ignored.  

Function Command


Command Format:

<TaskID><F><Command>… \\

Response:

If valid command and no problem during execution <ACK>\[<Response>\]… Otherwise <NAK><ErrorCode1>\]\[<ErrorCode2> \\

Setting Command



Command Format:

<TaskID> <S> <00> or
<TaskID><S><NoFunc><FuncBlock>
Where:

<TaskID> <S> <00> means Default the Task

<All (0x7F)> <S> <00> means Default All

<NoFunc> is number of function blocks to set in a task. Now only support <NoFunc> = 1

<FuncBlock> has the following format of <FuncID><Len><FuncData>

<FuncID> is a one byte Property ID.

<Len> is a one byte length count for a setting <FuncData>.

<FuncData> is a setting for a property.

Response:

If valid command and no problem during execution

<ACK>

Or (fail)

<NAK><ErrorCode1><ErrorCode2> 


For setting command,

reader will scan command first and send back error codes if it found any error(s), and then do setting if no error has been found.
<Unknown ID in Setting/Review list> (1600) and <Setting value out of range> (1400) will be treated as warning. i.e.: Do setting for other properties but skip setting for those properties which have warning. Warning will be sent to host.


      • Host Review Command


Command Format:
<TaskID><R><00> or
<TaskID><R><NoFunc><FuncID>
Where:
<NoFunc> is number of properties to review in a task. Now only support <NoFunc> = 1
<TaskID><R><00> allows host to review all properties in a task.
<TaskID><R><01><FuncID> allows host to review setting for a property.

Response:
<ACK><TaskID><NoFunc><FuncBLOCK>Or (fail)
<NAK><ErrorCode1><ErrorCode2>
<TaskID> is needed for each <FuncID> in review command.
.
Note that in contrast to the ITP format, in NGA protocol the LRC value does not come at the end, and does not include STX, length bytes, nor ETX in its calculated XOR value.