Tekkotsu Networking - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Tekkotsu Networking

Description:

stderr output is blocking for debugging purposes. Connections used ... Serialisation functions. Can derrive and make your own. MANY encode/decode combinations ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 8
Provided by: pagesCpsc
Category:

less

Transcript and Presenter's Notes

Title: Tekkotsu Networking


1
Tekkotsu Networking
  • CPSC 599.17/601.17

2
Basics
  • Provides UDP and TCP
  • Server and Client connections
  • Low level commands
  • Have to build packet
  • Serialise your data (with some help)
  • Bad Documentation
  • PLEASE post on the wiki if you find some
  • Use Tekkotsu monitor aibo-side code
  • /usr/local/Tekkotsu/Behaviors/Mon/

3
Interface
  • Uses callbacks for incoming data
  • Non-blocking sending calls
  • Mainly important for TCP
  • stderr output is blocking for debugging purposes
  • Connections used through the Socket class
  • one socket per connection
  • Sockets managed by Wireless class
  • Accessed through global wireless variable
  • System cout/cerr (Telnet ports)
  • serr-gtprintf, sout-gtprintf

4
API and commands
  • Create a new socket
  • Socket wireless-gtsocket(SocketNSTransportType_t)
  • (SOCK_DGRAM, SOCK_STREAM)
  • Get system Socket number
  • Int Socket-gtsock
  • Setup server
  • wireless-gtsetDaemon(Socket, bool)
  • wireless-gtsetReceiver(Socket_ID, callback)
  • Callbacks int callback_fn(char buf, int
    bytes)
  • wireless-gtlisten(Socket_ID, port)
  • (UDP server does not automatically connect)

5
API (Continued)
  • Disable Server
  • wireless-gtsetDaemon(Socket, false)
  • wireless-gtclose(Socket)
  • (NOTE Works even when no one connectd. Not so
    for client)
  • Status
  • bool Wireless-gtisConnected(Socket)
  • bool Socket-gtgetDaemon()
  • string Socket-gtgetPeerAddressAsString()
  • int Socket-gtgetPeerPort()
  • Connect
  • wireless-gtconnect(Socket,char host, int port)

6
Api Packets
  • Packet Write buffer
  • Socket-gtgetWriteBuffer(int bytes)
  • Socket-gtwrite(int bytes)
  • Socket-gtwrite(char buf, int bytes)
  • Careful when using together
  • Write does buffer copy
  • LoadSave class
  • Serialisation functions
  • Can derrive and make your own
  • MANY encode/decode combinations

7
Endianness
  • The AIBO is little Endian
  • (your pc is most likely BIG Endian)
  • Network protocols are big endian
  • Byte order is reversed for primitives
  • Tekkotsu does NOT automatically convert
  • AIBO is slow, your PC is faster
  • Means you have to do your own conversion!
  • Alternatives are Serializer class, but slow!
Write a Comment
User Comments (0)
About PowerShow.com