TR-064 SOAP Library
Public Types | Public Member Functions | Public Attributes | List of all members
TR064 Class Reference

Class to easily make TR-064 calls. This is the main class of this library. An object of this class keeps track of. More...

#include <tr064.h>

Public Types

enum  LoggingLevels {
  DEBUG_NONE, DEBUG_ERROR, DEBUG_WARNING, DEBUG_INFO,
  DEBUG_VERBOSE
}
 
enum  tr064_codes {
  TR064_CODE_UNKNOWNACTION = 401, TR064_CODE_FALSEARGUMENTS = 402, TR064_CODE_AUTHFAILED = 503, TR064_CODE_ARGUMENTVALUEINVALIDE = 600,
  TR064_CODE_ACTIONNOTAUTHORIZED = 606, TR064_CODE_ARRAYINDEXINVALID = 713, TR064_CODE_NOSUCHENTRY = 714, TR064_CODE_INTERNALERROR = 820,
  TR064_CODE_SECONDFACTORAUTHREQUIRED = 866, TR064_CODE_SECONDFACTORAUTHBLOCKED = 867, TR064_CODE_SECONDFACTORAUTHBUSY = 868
}
 HTTP codes see RFC7231.
 

Public Member Functions

 TR064 ()
 Library/Class to easily make TR-064 calls. Do not construct this unless you have a working connection to the device!
 
 TR064 (uint16_t port, const String &ip, const String &user, const String &pass)
 Library/Class to easily make TR-064 calls. Do not construct this unless you have a working connection to the device! More...
 
TR064setServer (uint16_t port, const String &ip, const String &user, const String &pass)
 Set the server parameters, needed if the empty constructor was used. More...
 
void init ()
 Initializes the library. Needs to be explicitly called. There should already be a working connection to the device.
 
int state ()
 Returns the State of Service Load. More...
 
bool action (const String &service, const String &act, String params[][2]={}, int nParam=0, const String &url="")
 This function will call an action on the service of the device with certain parameters and return values. It will fill the array req with the values of the assiciated return variables of the request. In order to understand how to construct such a call, please consult the Github page. More...
 
bool action (const String &service, const String &act, String params[][2], int nParam, String(*req)[2], int nReq, const String &url="")
 This function will call an action on the service of the device with certain parameters. In order to understand how to construct such a call, please consult the Github page. More...
 
String md5String (const String &s)
 Translates a string into its MD5 hash. More...
 
String byte2hex (byte number)
 Translates a byte number into a hex number. More...
 

Public Attributes

int debug_level
 Available levels are DEBUG_NONE, DEBUG_ERROR, DEBUG_WARNING, DEBUG_INFO, and DEBUG_VERBOSE.
 

Detailed Description

Class to easily make TR-064 calls. This is the main class of this library. An object of this class keeps track of.

Member Enumeration Documentation

◆ LoggingLevels

Different debug level DEBUG_NONE ///< Print no debug messages whatsoever DEBUG_ERROR ///< Only print error messages DEBUG_WARNING ///< Only print error and warning messages DEBUG_INFO ///< Print error, warning and info messages DEBUG_VERBOSE ///< Print all messages

Constructor & Destructor Documentation

◆ TR064()

TR064::TR064 ( uint16_t  port,
const String &  ip,
const String &  user,
const String &  pass 
)

Library/Class to easily make TR-064 calls. Do not construct this unless you have a working connection to the device!

Parameters
portPort number to be used to establish the TR-064 connection.
ipIP address to be used to establish the TR-064 connection.
userUser name to be used to establish the TR-064 connection.
passPassword to be used to establish the TR-064 connection.

Member Function Documentation

◆ setServer()

TR064 & TR064::setServer ( uint16_t  port,
const String &  ip,
const String &  user,
const String &  pass 
)

Set the server parameters, needed if the empty constructor was used.

Returns
Reference to this object
Parameters
portPort number to be used to establish the TR-064 connection.
ipIP address to be used to establish the TR-064 connection.
userUser name to be used to establish the TR-064 connection.
passPassword to be used to establish the TR-064 connection.

◆ state()

int TR064::state ( )

Returns the State of Service Load.

Returns
The State. TR064_NO_SERVICES / TR064_SERVICES_LOADED

◆ action() [1/2]

bool TR064::action ( const String &  service,
const String &  act,
String  params[][2] = {},
int  nParam = 0,
const String &  url = "" 
)

This function will call an action on the service of the device with certain parameters and return values. It will fill the array req with the values of the assiciated return variables of the request. In order to understand how to construct such a call, please consult the Github page.

Parameters
serviceThe name of the service you want to adress.
actThe action you want to perform on the service.
paramsA list of pairs of input parameters and values, e.g params[][2] = {{ "arg1", "value1" }, { "arg2", "value2" }}.
nParamThe number of input parameters you passed.
urlThe url you want to call.
Returns
success state.

◆ action() [2/2]

bool TR064::action ( const String &  service,
const String &  act,
String  params[][2],
int  nParam,
String(*)  req[2],
int  nReq,
const String &  url = "" 
)

This function will call an action on the service of the device with certain parameters. In order to understand how to construct such a call, please consult the Github page.

Parameters
serviceThe name of the service you want to adress.
actThe action you want to perform on the service.
paramsA list of pairs of input parameters and values, e.g params[][2] = {{ "arg1", "value1" }, { "arg2", "value2" }}.
nParamThe number of input parameters you passed.
reqA list of pairs of response parameters and values, e.g req[][2] = {{ "resp1", "" }, { "resp2", "" }} will be turned into req[][2] = {{ "resp1", "value1" }, { "resp2", "value2" }}
nReqThe number of response parameters you passed.
urlThe url you want to call.
Returns
success state.

◆ md5String()

String TR064::md5String ( const String &  text)

Translates a string into its MD5 hash.

Parameters
textInput string of which to calculcate the md5 hash.
Returns
The calculated MD5 hash (as String).

◆ byte2hex()

String TR064::byte2hex ( byte  number)

Translates a byte number into a hex number.

Parameters
numberbyte number to be translated to hex.
Returns
Translated hex number (as String).

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