BayEOSArduino Library
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BaySIM800 Class Reference
Inheritance diagram for BaySIM800:
Inheritance graph
[legend]
Collaboration diagram for BaySIM800:
Collaboration graph
[legend]

Public Member Functions

 BaySIM800 (HardwareSerial &serial)
 
void readConfigFromStringPGM (const char *string)
 
uint8_t sendMultiFromBuffer (uint16_t maxsize=5000, bool ack_payload=false)
 
uint8_t sendPayloadWithAck (bool ack_payload=true)
 
uint8_t sendPayload (void)
 
uint8_t begin (long baud)
 
uint8_t init (void)
 
uint8_t changeIPR (long baud)
 
uint8_t isRegistered (void)
 
uint8_t isAttached (void)
 
uint8_t getRSSI (void)
 
DateTime now (void)
 
- Public Member Functions inherited from BayEOS
 BayEOS (void)
 
virtual uint8_t readIntoPayload (int timeout=5000)
 
virtual int available (void)
 
uint8_t sendError (const char *s)
 
uint8_t sendMessage (const char *s)
 
uint8_t createMessage (const char *s, uint8_t checksum=0, uint8_t frametype=BayEOS_Message)
 
uint8_t createActionResponse (uint8_t key, uint8_t status)
 
void startFrame (void)
 
void startFrame (uint8_t type)
 
void startOriginFrame (const char *o, uint8_t routed=0)
 
void startDataFrame (uint8_t subtype=BayEOS_Float32le, uint8_t checksum=0)
 
void startDataFrameWithOrigin (uint8_t subtype, const char *o, uint8_t checksum=0, uint8_t routed=0)
 
uint8_t addChannelValue (float v, uint8_t channel_number=0)
 
uint8_t addChannelValue (double v, uint8_t channel_number=0)
 
uint8_t addChannelValue (long v, uint8_t channel_number=0)
 
uint8_t addChannelValue (unsigned long v, uint8_t channel_number=0)
 
uint8_t addChannelValue (int v, uint8_t channel_number=0)
 
uint8_t addChannelValue (unsigned int v, uint8_t channel_number=0)
 
uint8_t addChannelValue (int8_t v, uint8_t channel_number=0)
 
uint8_t addChannelValue (uint8_t v, uint8_t channel_number=0)
 
uint8_t addChannelValue (float v, const char *channel_label)
 
uint8_t addChannelValue (double v, const char *channel_label)
 
uint8_t addChannelValue (long v, const char *channel_label)
 
uint8_t addChannelValue (unsigned long v, const char *channel_label)
 
uint8_t addChannelValue (int v, const char *channel_label)
 
uint8_t addChannelValue (unsigned int v, const char *channel_label)
 
uint8_t addChannelValue (int8_t v, const char *channel_label)
 
uint8_t addChannelValue (uint8_t v, const char *channel_label)
 
uint8_t addChecksum (void)
 
uint8_t validateChecksum (void)
 
void startRoutedFrame (uint16_t sourceMyID, uint16_t sourcePANID, uint8_t rssi=0)
 
void startDelayedFrame (unsigned long delay)
 
void startDelayedSecondFrame (unsigned long delay)
 
void startRF24Frame (uint8_t pipe)
 
void startTimestampFrame (unsigned long timestamp)
 
void startCommand (uint8_t cmd_api)
 
void startCommandResponse (uint8_t cmd_api)
 
uint8_t addToPayload (uint8_t b)
 
uint8_t addToPayload (const void *p, uint8_t length)
 
uint8_t addToPayload (const uint8_t *c)
 
uint8_t addToPayload (const char *s)
 
uint8_t addToPayload (float f)
 
uint8_t addToPayload (unsigned long l)
 
uint8_t addToPayload (long l)
 
uint8_t addToPayload (int w)
 
uint8_t addToPayload (uint16_t w)
 
uint8_t getPayloadBytesLeft (void) const
 
uint8_t getPayloadLength (void) const
 
uint8_t getPacketLength (void) const
 
const uint8_t * getPayload (void) const
 
uint8_t getPayload (uint8_t index) const
 
uint8_t sendOrBuffer (void)
 
uint8_t sendFromBuffer (void)
 
uint8_t writeToBuffer (void)
 
uint8_t readFromBuffer (void)
 
uint8_t readBinaryFromBuffer (unsigned long pos)
 
uint8_t readBinaryFromBuffer (unsigned long pos, unsigned long end, unsigned long vpos)
 
void setBuffer (BayEOSBuffer &buffer, uint16_t max_skip=0)
 

Protected Member Functions

uint8_t postHeader (uint16_t size)
 
uint8_t post (void)
 
void readAck (void)
 
void skipChars (void)
 
uint8_t wait_forOK (uint16_t timeout)
 
uint8_t wait_forPGM (const char *str, uint16_t timeout, uint8_t bytes=0, char *buffer=NULL)
 
uint8_t wait_for_available (int bytes=1)
 
void printPGM (const char *str)
 
void printlnPGM (const char *str)
 
uint8_t printlnPGM (const char *str, uint16_t timeout)
 
void urlDecode (char *str)
 
uint8_t strlenURLencoded (const char *str)
 
void printURLencoded (const char *str)
 
uint8_t URLencoded (char c, bool print=true)
 
uint8_t getConfig (const char *config, bool print=true, bool urlencoded=false)
 

Protected Attributes

HardwareSerial * _serial
 
long _baud
 
const char * _url
 
const char * _user
 
const char * _password
 
const char * _sender
 
const char * _apn
 
const char * _prov_user
 
const char * _prov_pw
 
const char * _pin
 
char _base64buffer [BaySIM800_BUFFER]
 
uint8_t _tx_error_count
 
uint16_t _mtu
 
uint16_t _timeout
 

Static Protected Attributes

static const char *const _urlencodedChars = "$&+,/:;=?@ <>#%{}|~[]`"
 

Additional Inherited Members

- Public Attributes inherited from BayEOS
uint8_t _payload [BayEOS_MAX_PAYLOAD]
 
uint8_t _next
 
uint8_t _success
 
uint8_t _failure_counter
 
uint16_t _max_skip
 
uint16_t _skip_counter
 
BayEOSBuffer_buffer
 

Member Function Documentation

◆ begin()

uint8_t BaySIM800::begin ( long  baud)

Switch on GPRS-Modem 0 == GPRS-modem is up and responding OK 1 == Communication-ERROR 2 == PIN failed 3 == PIN locked 4 == No CPIN READY 5 == Not CREG 6 == Not CGATT 7 == No SIM Card

if unlock_only is set, function returns already after unlocking the modem

◆ getRSSI()

uint8_t BaySIM800::getRSSI ( void  )

Disconnect from the web

◆ isAttached()

uint8_t BaySIM800::isAttached ( void  )

Checks if modem is attached to network

◆ isRegistered()

uint8_t BaySIM800::isRegistered ( void  )

Checks if modem is registered to network

◆ now()

DateTime BaySIM800::now ( void  )

Get time from RTC

◆ postHeader()

uint8_t BaySIM800::postHeader ( uint16_t  size)
protected

Helper functions for different Post requests

◆ readConfigFromStringPGM()

void BaySIM800::readConfigFromStringPGM ( const char *  string)

read config from string - use | as field delimiter url|user|password|Sender|APN|APN-USER|APN-PW|PIN|

◆ sendMultiFromBuffer()

uint8_t BaySIM800::sendMultiFromBuffer ( uint16_t  maxsize = 5000,
bool  ack_payload = false 
)

Send several frames in one post request returns 0 for success 1 == No HTTP 200 2 == No connect to network 3 == no connect to server 4 == could not send data to moden 6 and more == result code of init()+5

◆ sendPayload()

uint8_t BaySIM800::sendPayload ( void  )
virtual

Send current payload buffer Has to be overwritten by implementation

Implements BayEOS.


The documentation for this class was generated from the following files: