File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
include/cellular/framework/API
drivers/cellular/QUECTEL/BC95 Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -352,8 +352,9 @@ class ATHandler {
352
352
*
353
353
* @param str input buffer to be converted to hex ascii
354
354
* @param size of the input param str
355
+ * @param quote_string if true it will add the double-quote character at beginning and end of string
355
356
*/
356
- void write_hex_string (const char *str, size_t size);
357
+ void write_hex_string (const char *str, size_t size, bool quote_string = true );
357
358
358
359
/* * Reads as string and converts result to integer. Supports only non-negative integers.
359
360
*
Original file line number Diff line number Diff line change @@ -1551,21 +1551,25 @@ void ATHandler::set_send_delay(uint16_t send_delay)
1551
1551
_at_send_delay = std::chrono::duration<uint16_t , std::milli>(send_delay);
1552
1552
}
1553
1553
1554
- void ATHandler::write_hex_string (const char *str, size_t size)
1554
+ void ATHandler::write_hex_string (const char *str, size_t size, bool quote_string )
1555
1555
{
1556
1556
// do common checks before sending subparameter
1557
1557
if (check_cmd_send () == false ) {
1558
1558
return ;
1559
1559
}
1560
1560
1561
- (void ) write (" \" " , 1 );
1561
+ if (quote_string) {
1562
+ (void ) write (" \" " , 1 );
1563
+ }
1562
1564
char hexbuf[2 ];
1563
1565
for (size_t i = 0 ; i < size; i++) {
1564
1566
hexbuf[0 ] = hex_values[((str[i]) >> 4 ) & 0x0F ];
1565
1567
hexbuf[1 ] = hex_values[(str[i]) & 0x0F ];
1566
1568
write (hexbuf, 2 );
1567
1569
}
1568
- (void ) write (" \" " , 1 );
1570
+ if (quote_string) {
1571
+ (void ) write (" \" " , 1 );
1572
+ }
1569
1573
}
1570
1574
1571
1575
void ATHandler::set_baud (int baud_rate)
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc
211
211
return NSAPI_ERROR_PARAMETER;
212
212
}
213
213
214
- _at.write_hex_string ((char *)data, size);
214
+ _at.write_hex_string ((char *)data, size, false );
215
215
_at.cmd_stop ();
216
216
_at.resp_start ();
217
217
// skip socket id
You can’t perform that action at this time.
0 commit comments