libPDU.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef LIBPDU_H
  2. #define LIBPDU_H
  3. #define NPC7 63
  4. class PDU {
  5. public:
  6. PDU (){ this->tp_dcs_alpha = 0; };
  7. ~PDU (){};
  8. int setText(String);
  9. int setSender(String);
  10. String encode(void);
  11. String decode(String);
  12. String decode(String, uint8_t);
  13. private:
  14. int smsc_length;
  15. int smsc_type_of_address;
  16. String smsc_number;
  17. int sms_deliver; //SMS-DELIVER message
  18. int sender_length;
  19. int sender_type_of_address;
  20. String sender_number;
  21. int tp_length; // lenght of data ( dependent of dcs)
  22. String tp_data; // the data of the message
  23. String tp_text; //--internal use for storing sms text before creating the pdu string
  24. int tp_dcs_alpha; //--internal use for storing alphabet size when creating the pdu string
  25. String semiOctetToString (String);
  26. String stringToSemiOctet (String);
  27. int hexStringToInt (String);
  28. String intToHexString (int);
  29. int binStringToInt (String);
  30. String intToBinString (int);
  31. int pow(int , int );
  32. String userTextTo7(void);
  33. };
  34. #endif //LIBPDU_LIBPDU_H