#[unsafe(no_mangle)]pub extern "C" fn CmdExchange(
requestJSON: *mut c_char,
responseJSON: *mut c_char,
maxResponseLen: i32,
) -> i32Expand description
Blocking call to send out request and wait for response from R/W with 1sec timeout
§Parameters
requestJSON: Request to R/W in JSON formatresponseJSON: Buffer to store response from R/W in JSON formatmaxResponseLen: Size of responseJSON buffer (minimum size is 4096 bytes)
§Returns
0: Message send/receive succeeded-1: COM not opened-2: Communication error with R/W-3: responseJSON buffer size not enough-6: Link busy
§Safety
The caller must ensure:
requestJSONpoints to a valid null-terminated stringresponseJSONpoints to a writable buffer of at leastmaxResponseLenbytesmaxResponseLenis positive and represents the actual buffer size (minimum 4096)