Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store and Forward coding #33

Open
N6RFM opened this issue Aug 28, 2020 · 2 comments
Open

Store and Forward coding #33

N6RFM opened this issue Aug 28, 2020 · 2 comments

Comments

@N6RFM
Copy link

N6RFM commented Aug 28, 2020

Hi,

In the FS-2 sketch, message store and forwarding is supported by the folling code

case 'b':
addStoreAndForward(0x1337BEEF, "Hello there!");
break;

I'm not a programmer, but it appears that 0x1337BEEF is a memory address? Is there a limit on the numberof characters which may be sent to this address?

Also, please comment on the code below. This is intended to send a message (up to 32 characters) but unclear to me how to specify the correct memory address.

//adapted from code provided by K4KDR
  
String myCall="N6RFM";
String mySFtext="Hello from";

 void sendSF() {
  
  // get data to be stored and forwarded
  char optData[32];
  // text to transmit + some additional underscores for blank space after
  String cq = mySFtext + myCall + " ";
  // Length (with one extra character for the null terminator)
  int str_len = cq.length() + 1; 
  cq.toCharArray(optData, str_len);
  
  Serial.println();
  Serial.print(F("Sending Store annd Forward text "));

  // data to transmit
  uint8_t functionId = CMD_STORE_AND_FORWARD_ADD;   //unclear how to specify target memory address ?0x1337BEEF
  uint8_t optDataLen = strlen(optData);

  // build frame
  uint8_t len = FCP_Get_Frame_Length(callsign, optDataLen);
  uint8_t* frame = new uint8_t[len];
  FCP_Encode(frame, callsign, functionId, optDataLen, (uint8_t*)optData);

  // send data
  int state = radio.transmit(frame, len);
  delete[] frame;

Thanks so much!
Bob N6RFM

@Gipsonek
Copy link
Contributor

0x1337BEEF is a 4-byte ID for your message, chosen by the user (see the communication protocol specs). If you want to request the saved message later, you send the ID and the satellite will return the message with that ID. If you send a message with the same ID, the original one will be overwritten.

The above link also contains information on how to specify the ID (it's the first 4 bytes of optional data), as well as the maximum message length (28 bytes).

@N6RFM
Copy link
Author

N6RFM commented Aug 29, 2020

Thank you for the explanation. All Best, Bob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants