
Public Member Functions | |
| SocketHandle | Open (uint16_t socket, const char *password=0) |
| Open a logical socket on the device. | |
| void | Close (Socket &socket) |
| Closes a non-default socket (i.e. | |
| void | ClearHalt () |
| Clears the USB Halt bit on both the read and write endpoints. | |
Protected Member Functions | |
| bool | SequencePacket (const Data &data) |
| Returns true if this is a sequence packet that should be ignored. | |
Definition at line 46 of file socket.h.
| void Barry::SocketZero::ClearHalt | ( | ) |
| void Barry::SocketZero::Close | ( | Socket & | socket | ) |
Closes a non-default socket (i.e.
non-zero socket number)
The packet sequence is just like Open(), except the command is CLOSE_SOCKET.
| Barry::Error |
| SocketHandle Barry::SocketZero::Open | ( | uint16_t | socket, | |
| const char * | password = 0 | |||
| ) |
Open a logical socket on the device.
Both the socket number and the flag are based on the response to the SELECT_MODE command. See Controller::SelectMode() for more info on this.
The packet sequence is normal for most socket operations.
| Barry::Error | Thrown on protocol error. | |
| Barry::BadPassword | Thrown on invalid password, or not enough retries left on device. |
Definition at line 441 of file socket.cc.
References Barry::Packet::Command().
Referenced by Barry::Mode::Mode::RetryPassword().


| bool Barry::SocketZero::SequencePacket | ( | const Data & | data | ) | [protected] |
Returns true if this is a sequence packet that should be ignored.
This function is used in SocketZero::RawReceive() in order to determine whether to keep reading or not. By default, this function checks whether the packet is a sequence packet or not, and returns true if so. Also, if it is a sequence packet, it checks the validity of the sequence number.
If sequence packets become important in the future, this function could be changed to call a user-defined callback, in order to handle these things out of band.
1.7.1