updated naming
This commit is contained in:
parent
4ba8332404
commit
a89791f251
30
README.md
30
README.md
@ -1,3 +1,29 @@
|
|||||||
# SimpleSerialProtocol
|
# Simple Serial Protocol (SSP)
|
||||||
|
|
||||||
Simple Serial Protocol (SSP) for arduino devices.
|
SSP is a easy-to-use serial protocol system for arduino type devices.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```python
|
||||||
|
import foobar
|
||||||
|
|
||||||
|
foobar.pluralize('word') # returns 'words'
|
||||||
|
foobar.pluralize('goose') # returns 'geese'
|
||||||
|
foobar.singularize('phenomena') # returns 'phenomenon'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
||||||
|
|
||||||
|
Please make sure to update tests as appropriate.
|
||||||
|
|
||||||
|
## License
|
||||||
|
[MIT](https://choosealicense.com/licenses/mit/)
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "SimpleSerialProtocol",
|
"name": "SimpleSerialProtocol",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "Easy-to-use serial protocol system for arduino type devices.",
|
"description": "Easy-to-use serial protocol system for arduino type devices.",
|
||||||
"keywords": "Serial, Connectivity, USB, Simple",
|
"keywords": "Serial, Connectivity, USB, Simple",
|
||||||
"repository":
|
"repository":
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "Packet.h"
|
#include "Packet.h"
|
||||||
#include "SerialConnection.h"
|
#include "SerialConnection.h"
|
||||||
|
|
||||||
class SSPDevice
|
class SimpleSerialProtocol
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SerialConnection serialConnection;
|
SerialConnection serialConnection;
|
||||||
@ -34,7 +34,7 @@ class SSPDevice
|
|||||||
bool sendPacket(char* ID, char* command, char* data);
|
bool sendPacket(char* ID, char* command, char* data);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool SSPDevice::init(int deviceIndex, unsigned long baud) {
|
bool SimpleSerialProtocol::init(int deviceIndex, unsigned long baud) {
|
||||||
// Check if device index is in range
|
// Check if device index is in range
|
||||||
if (deviceIndex < 0 || deviceIndex > 4) {
|
if (deviceIndex < 0 || deviceIndex > 4) {
|
||||||
return false;
|
return false;
|
||||||
@ -49,7 +49,7 @@ bool SSPDevice::init(int deviceIndex, unsigned long baud) {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool SSPDevice::receivePackets(void (*callback)(Packet)) {
|
bool SimpleSerialProtocol::receivePackets(void (*callback)(Packet)) {
|
||||||
// Try to get buffer from serial device
|
// Try to get buffer from serial device
|
||||||
char* receivedBuffer = serialConnection.handle();
|
char* receivedBuffer = serialConnection.handle();
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ bool SSPDevice::receivePackets(void (*callback)(Packet)) {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool SSPDevice::sendPacket(char* ID, char* command, char* data) {
|
bool SimpleSerialProtocol::sendPacket(char* ID, char* command, char* data) {
|
||||||
// Create new packet buffer
|
// Create new packet buffer
|
||||||
char serialPacketBuffer[serialConnection.getBufferSize()];
|
char serialPacketBuffer[serialConnection.getBufferSize()];
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user