@@ -238,20 +238,24 @@ void JTEncode::wspr_encode(String call, String loc, uint8_t dbm, uint8_t * symbo
238238 * Takes an arbitrary message and returns a FSQ channel symbol table.
239239 *
240240 * from_call - Callsign of issuing station (maximum size: 20)
241- * message - Null-terminated message string, no greater than 200 chars in length
241+ * message - Null-terminated message string, no greater than 130 chars in length
242242 * symbols - Array of channel symbols to transmit retunred by the method.
243243 * Ensure that you pass a uint8_t array of at least the size of the message
244244 * plus 5 characters to the method. Terminated in 0xFF.
245245 *
246246 */
247247void JTEncode::fsq_encode (String from_call, String message, uint8_t * symbols)
248248{
249- char tx_buffer[255 ];
249+ char tx_buffer[155 ];
250250 char * tx_message;
251251 uint16_t symbol_pos = 0 ;
252252 uint8_t i, fch, vcode1, vcode2, tone;
253253 uint8_t cur_tone = 0 ;
254254
255+ // Clear out the transmit buffer
256+ // -----------------------------
257+ memset (tx_buffer, 0 , 155 );
258+
255259 // Create the message to be transmitted
256260 // ------------------------------------
257261 sprintf (tx_buffer, " \n %s: %s" , from_call.c_str (), message.c_str ());
@@ -314,26 +318,22 @@ void JTEncode::fsq_encode(String from_call, String message, uint8_t * symbols)
314318}
315319
316320/*
317- * fsq_dir_encode(String from_call, String to_call, String cmd, String message, uint8_t * symbols)
321+ * fsq_dir_encode(String from_call, String to_call, char cmd, String message, uint8_t * symbols)
318322 *
319323 * Takes an arbitrary message and returns a FSQ channel symbol table.
320324 *
321325 * from_call - Callsign from which message is directed (maximum size: 20)
322326 * to_call - Callsign to which message is directed (maximum size: 20)
323- * cmd - Directed command (maximum size: 20)
324- * message - Null-terminated message string, no greater than 200 chars in length
327+ * cmd - Directed command
328+ * message - Null-terminated message string, no greater than 100 chars in length
325329 * symbols - Array of channel symbols to transmit retunred by the method.
326330 * Ensure that you pass a uint8_t array of at least the size of the message
327331 * plus 5 characters to the method. Terminated in 0xFF.
328332 *
329333 */
330- void JTEncode::fsq_dir_encode (String from_call, String to_call, String cmd, String message, uint8_t * symbols)
334+ void JTEncode::fsq_dir_encode (String from_call, String to_call, char cmd, String message, uint8_t * symbols)
331335{
332- // char from_call_array[20];
333- // char to_call_array[20];
334- // char cmd_array[20];
335- // char message_array[200];
336- char tx_buffer[255 ];
336+ char tx_buffer[155 ];
337337 char * tx_message;
338338 uint16_t symbol_pos = 0 ;
339339 uint8_t i, fch, vcode1, vcode2, tone, from_call_crc;
@@ -343,11 +343,15 @@ void JTEncode::fsq_dir_encode(String from_call, String to_call, String cmd, Stri
343343 // ---------------------------
344344 from_call_crc = crc8 (from_call.c_str ());
345345
346+ // Clear out the transmit buffer
347+ // -----------------------------
348+ memset (tx_buffer, 0 , 155 );
349+
346350 // Create the message to be transmitted
347351 // We are building a directed message here.
348352 // FSQ very specifically needs " \b " in
349353 // directed mode to indicate EOT. A single backspace won't do it.
350- sprintf (tx_buffer, " \n %s:%02x%s%s %s%s" , from_call.c_str (), from_call_crc, to_call.c_str (), cmd. c_str () , message.c_str (), " \b " );
354+ sprintf (tx_buffer, " \n %s:%02x%s%c %s%s" , from_call.c_str (), from_call_crc, to_call.c_str (), cmd, message.c_str (), " \b " );
351355
352356 tx_message = tx_buffer;
353357
0 commit comments