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 {
352352 *
353353 * @param str input buffer to be converted to hex ascii
354354 * @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
355356 */
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 );
357358
358359 /* * Reads as string and converts result to integer. Supports only non-negative integers.
359360 *
Original file line number Diff line number Diff line change @@ -1551,21 +1551,25 @@ void ATHandler::set_send_delay(uint16_t send_delay)
15511551 _at_send_delay = std::chrono::duration<uint16_t , std::milli>(send_delay);
15521552}
15531553
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 )
15551555{
15561556 // do common checks before sending subparameter
15571557 if (check_cmd_send () == false ) {
15581558 return ;
15591559 }
15601560
1561- (void ) write (" \" " , 1 );
1561+ if (quote_string) {
1562+ (void ) write (" \" " , 1 );
1563+ }
15621564 char hexbuf[2 ];
15631565 for (size_t i = 0 ; i < size; i++) {
15641566 hexbuf[0 ] = hex_values[((str[i]) >> 4 ) & 0x0F ];
15651567 hexbuf[1 ] = hex_values[(str[i]) & 0x0F ];
15661568 write (hexbuf, 2 );
15671569 }
1568- (void ) write (" \" " , 1 );
1570+ if (quote_string) {
1571+ (void ) write (" \" " , 1 );
1572+ }
15691573}
15701574
15711575void 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
211211 return NSAPI_ERROR_PARAMETER;
212212 }
213213
214- _at.write_hex_string ((char *)data, size);
214+ _at.write_hex_string ((char *)data, size, false );
215215 _at.cmd_stop ();
216216 _at.resp_start ();
217217 // skip socket id
You can’t perform that action at this time.
0 commit comments