KSduino 

 The Device Network
Your IP Address is: 54.161.130.145

DOCUMENTATION

KSduino.h File Reference

Class declaration for KSduino. More...

#include <Arduino.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <utility/w5100.h>
+ Include dependency graph for KSduino.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  KSduino
 Main Library Class. More...
class  KSduinoParameter
 Subclass with additional functions for working with parameters. More...

Typedefs

typedef int(* ksdReceptionFunc )(int device_id, char param, int num, void *value, char *message)
 Reception callback function type definition.
typedef int(* ksdBeforeReset )()
 Before reset callback function type definition.
typedef int(* ksdLostPacketCallback )(int type, int packetNum)
 Lost packet callback function type definition.

Functions

 KSduinoParameter (KSduino *ksd, char *parameter_name, float parameter_accuracy=0.00, uint16_t rt=0, byte parameter_sendall=0)
 Constructor to define KSduinoParameter subclass.
template<typename ValueType >
int addParameter (ValueType value)
 Add parameter.
char * name (void)
 Get this parameter name.
template<typename ValueType >
int check (ValueType value)
 Check if this parameter ready to send.

Detailed Description

Class declaration for KSduino.

Definition in file KSduino.h.


Typedef Documentation

typedef int(* ksdBeforeReset)()

Before reset callback function type definition.

Returns:
1 - to continue reset, 0 - to skip reset

Definition at line 101 of file KSduino.h.

typedef int(* ksdLostPacketCallback)(int type, int packetNum)

Lost packet callback function type definition.

Parameters:
[in]typeType of callback: 1 - lost pscket, 2 - wrong packet
[in]packetNumNumber of lost (or wrong) packet
Returns:
This function should return 1

Definition at line 112 of file KSduino.h.

typedef int(* ksdReceptionFunc)(int device_id, char param, int num, void *value, char *message)

Reception callback function type definition.

Parameters:
[in]device_idWhich id send this packet
[in]paramParameter type
[in]numParameter number
[in]valueValue of parameter
[in]messageMessage or NULL of not used
Returns:
This function should return 1

Definition at line 91 of file KSduino.h.


Function Documentation

template<typename ValueType >
int KSduinoParameter::addParameter ( ValueType  value)

Add parameter.

Parameters:
[in]valueParameters value
Returns:
1 - if this parametr added, or 0 - if this parameter not ready to send (see KSduinoParameter::check)

This function shoud be send between KSduino::beginPacket and KSduino::endPacket functions. This function adds parameter and it value to paket started with KSduino::beginPacket function.

See KSduino::beginPacket, KSduino::addParameter and KSduino::endPacket to get additional information.

Definition at line 587 of file KSduino.h.

Referenced by KSduino::sendOne(), and KSduino::sendToOther().

template<typename ValueType >
int KSduinoParameter::check ( ValueType  value)

Check if this parameter ready to send.

Parameters:
[in]valueParameters value
Returns:
1 - if this Parameters value is ready to send

Definition at line 616 of file KSduino.h.

KSduinoParameter::KSduinoParameter ( KSduino ksd,
char *  parameter_name,
float  parameter_accuracy = 0.00,
uint16_t  rt = 0,
byte  parameter_sendall = 0 
)

Constructor to define KSduinoParameter subclass.

Parameters:
[in]ksdReference to KSduino class
[in]parameter_nameParameter name
[in]parameter_accuracyAccuracy of parameter: difference between previouse and current value. Values sends to server if difference between previouse and current value more than parameter_sendall value.
[in]rtRepeat time: time in seconds after which one parameters value wil be sent even though values of parameter_sendall and parameter_accuracy
[in]parameter_sendallSend all values: 0 - send only different values (default), 1 - send all values

Definition at line 526 of file KSduino.h.

char* KSduinoParameter::name ( void  )

Get this parameter name.

Returns:
parameter name char* array

Definition at line 601 of file KSduino.h.

Created with KSNews

HOME | CONTACTS | INFORMER | SHORTENER | DOCUMENTATION | HELP

Copyright © 2012-2013, The KSduino Project