fork allowing use of the latest official mbed networking library
Fork of Agentbed by
Diff: Agentbed.h
- Revision:
- 3:81f25e337afc
- Parent:
- 1:b2db0ea96703
--- a/Agentbed.h Fri Jan 28 09:17:03 2011 +0000 +++ b/Agentbed.h Tue Apr 02 19:53:28 2013 +0000 @@ -35,7 +35,6 @@ //Frees a pointer only if it is !NULL and sets its value to NULL. #include "mbed.h" -#include "EthernetNetIf.h" #include "UDPSocket.h" #include <stdlib.h> @@ -544,33 +543,26 @@ SNMP_VALUE VALUE; } SNMP_PDU; -class AgentbedClass { +class SNMP { public: // Agent functions - SNMP_API_STAT_CODES begin(EthernetNetIf *eth); - SNMP_API_STAT_CODES begin(char *getCommName, char *setCommName, uint16_t port, EthernetNetIf *eth); - void listen(UDPSocketEvent); - SNMP_API_STAT_CODES requestPdu(SNMP_PDU *pdu); - SNMP_API_STAT_CODES responsePdu(SNMP_PDU *pdu); - void onPduReceive(onPduReceiveCallback pduReceived); + SNMP_API_STAT_CODES init(); + SNMP_API_STAT_CODES init(char *getCommName, char *setCommName); + SNMP_API_STAT_CODES toPdu( SNMP_PDU *pdu,char *_packet,uint16_t _packetSize); + uint16_t fromPdu(SNMP_PDU *pdu,char *_packet); void freePdu(SNMP_PDU *pdu); // Helper functions private: - byte _packet[SNMP_MAX_PACKET_LEN]; - uint16_t _packetSize; uint16_t _packetPos; SNMP_PDU_TYPES _dstType; char *_getCommName; size_t _getSize; char *_setCommName; size_t _setSize; - onPduReceiveCallback _callback; - UDPSocket *udpsock; - Host _dst; }; -//extern AgentbedClass Agentbed; +//extern SNMP Agentbed; #endif