From a89791f25189dad01b3fa2149c83843cd48770aa Mon Sep 17 00:00:00 2001 From: Nick Leeman Date: Tue, 30 Mar 2021 00:05:34 +0200 Subject: [PATCH] updated naming --- README.md | 30 +++++++++++++++++-- library.json | 2 +- {include => src}/Packet.h | 0 {include => src}/SerialConnection.h | 0 .../SSPDevice.h => src/SimpleSerialProtocol.h | 8 ++--- 5 files changed, 33 insertions(+), 7 deletions(-) rename {include => src}/Packet.h (100%) rename {include => src}/SerialConnection.h (100%) rename include/SSPDevice.h => src/SimpleSerialProtocol.h (91%) diff --git a/README.md b/README.md index 3773dd1..22cfb8e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ -# SimpleSerialProtocol +# Simple Serial Protocol (SSP) -Simple Serial Protocol (SSP) for arduino devices. \ No newline at end of file +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/) \ No newline at end of file diff --git a/library.json b/library.json index 31aeb71..f47c965 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SimpleSerialProtocol", - "version": "1.0.0", + "version": "1.1.0", "description": "Easy-to-use serial protocol system for arduino type devices.", "keywords": "Serial, Connectivity, USB, Simple", "repository": diff --git a/include/Packet.h b/src/Packet.h similarity index 100% rename from include/Packet.h rename to src/Packet.h diff --git a/include/SerialConnection.h b/src/SerialConnection.h similarity index 100% rename from include/SerialConnection.h rename to src/SerialConnection.h diff --git a/include/SSPDevice.h b/src/SimpleSerialProtocol.h similarity index 91% rename from include/SSPDevice.h rename to src/SimpleSerialProtocol.h index 3d432ec..62689e7 100644 --- a/include/SSPDevice.h +++ b/src/SimpleSerialProtocol.h @@ -24,7 +24,7 @@ #include "Packet.h" #include "SerialConnection.h" -class SSPDevice +class SimpleSerialProtocol { private: SerialConnection serialConnection; @@ -34,7 +34,7 @@ class SSPDevice 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 if (deviceIndex < 0 || deviceIndex > 4) { return false; @@ -49,7 +49,7 @@ bool SSPDevice::init(int deviceIndex, unsigned long baud) { return true; }; -bool SSPDevice::receivePackets(void (*callback)(Packet)) { +bool SimpleSerialProtocol::receivePackets(void (*callback)(Packet)) { // Try to get buffer from serial device char* receivedBuffer = serialConnection.handle(); @@ -92,7 +92,7 @@ bool SSPDevice::receivePackets(void (*callback)(Packet)) { return false; }; -bool SSPDevice::sendPacket(char* ID, char* command, char* data) { +bool SimpleSerialProtocol::sendPacket(char* ID, char* command, char* data) { // Create new packet buffer char serialPacketBuffer[serialConnection.getBufferSize()];