Skip to content

Commit 27c4e39

Browse files
Update api.md to include missing modules and functions
Co-Authored-By: abucknall@blues.com <abucknall@blues.com>
1 parent db68e1e commit 27c4e39

1 file changed

Lines changed: 254 additions & 2 deletions

File tree

docs/api.md

Lines changed: 254 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22

33
Members | Descriptions
44
--------------------------------|---------------------------------------------
5+
`namespace `[`notecard::binary_helpers`](#namespacenotecard_1_1binary__helpers) | Helper methods for performing binary transfers to and from a Notecard.
56
`namespace `[`notecard::card`](#namespacenotecard_1_1card) |
7+
`namespace `[`notecard::cobs`](#namespacenotecard_1_1cobs) | Functions for COBS encoding and decoding of bytearrays.
8+
`namespace `[`notecard::crc32`](#namespacenotecard_1_1crc32) | Functions for computing CRC32 checksums.
69
`namespace `[`notecard::env`](#namespacenotecard_1_1env) |
710
`namespace `[`notecard::file`](#namespacenotecard_1_1file) |
11+
`namespace `[`notecard::gpio`](#namespacenotecard_1_1gpio) | GPIO abstractions for different platforms.
812
`namespace `[`notecard::hub`](#namespacenotecard_1_1hub) |
13+
`namespace `[`notecard::md5`](#namespacenotecard_1_1md5) | Functions for computing MD5 hashes.
914
`namespace `[`notecard::note`](#namespacenotecard_1_1note) |
1015
`namespace `[`notecard::notecard`](#namespacenotecard_1_1notecard) |
16+
`namespace `[`notecard::timeout`](#namespacenotecard_1_1timeout) | Functions for managing timeouts.
17+
`namespace `[`notecard::transaction_manager`](#namespacenotecard_1_1transaction__manager) | Classes for managing Notecard transactions.
1118
`namespace `[`notecard::validators`](#namespacenotecard_1_1validators) |
1219

1320
# namespace `notecard::card`
@@ -20,6 +27,7 @@
2027
`public def `[`time`](#namespacenotecard_1_1card_1a0de0f6e72a2387d09aaaa4a719383313)`(card)` | Retrieve the current time and date from the Notecard.
2128
`public def `[`status`](#namespacenotecard_1_1card_1a13f03abe1576ab81ea8190e3074576ce)`(card)` | Retrieve the status of the Notecard.
2229
`public def `[`temp`](#namespacenotecard_1_1card_1aa15a26b60d8f8be7f994338f0af563cf)`(card,minutes)` | Retrieve the current temperature from the Notecard.
30+
`public def `[`transport`](#namespacenotecard_1_1card_1a9b8a6f1b58c7b5e55f8b961f9a847113)`(card,method,allow)` | Configure the Notecard's connectivity method.
2331
`public def `[`version`](#namespacenotecard_1_1card_1ac0a7ef1176b55152d42de04d39dfac54)`(card)` | Retrieve firmware version information from the Notecard.
2432
`public def `[`voltage`](#namespacenotecard_1_1card_1a1f9f65c34f1bd959d7902285a7537ce6)`(card,hours,offset,vmax,vmin)` | Retrieve current and historical voltage info from the Notecard.
2533
`public def `[`wireless`](#namespacenotecard_1_1card_1a10f5f4667d80f47674d1876df69b8e22)`(card,mode,apn)` | Retrieve wireless modem info or customize modem behavior.
@@ -134,6 +142,22 @@ Retrieve wireless modem info or customize modem behavior.
134142
#### Returns
135143
string The result of the Notecard request.
136144

145+
#### `public def `[`transport`](#namespacenotecard_1_1card_1a9b8a6f1b58c7b5e55f8b961f9a847113)`(card,method,allow)`
146+
147+
Configure the Notecard's connectivity method.
148+
149+
#### Parameters
150+
* `card` The current Notecard object.
151+
152+
* `method` The connectivity method to use.
153+
154+
* `allow` List of allowed connectivity methods.
155+
156+
#### Returns
157+
158+
#### Returns
159+
string The result of the Notecard request.
160+
137161
# namespace `notecard::env`
138162

139163
## Summary
@@ -485,7 +509,7 @@ Update a note in a DB Notefile by ID.
485509
#### Returns
486510
string The result of the Notecard request.
487511

488-
#### `public def `[`template`](#namespacenotecard_1_1note_1a1e625660366b3766ec9efa8270a7f5bb)`(card,file,body,length)`
512+
#### `public def `[`template`](#namespacenotecard_1_1note_1a1e625660366b3766ec9efa8270a7f5bb)`(card,file,body,length,port,compact)`
489513

490514
Create a template for new Notes in a Notefile.
491515

@@ -498,6 +522,10 @@ Create a template for new Notes in a Notefile.
498522

499523
* `length` If provided, the maximum length of a payload that can be sent in Notes for the template Notefile.
500524

525+
* `port` If provided, the port to use for the template Notefile.
526+
527+
* `compact` If True, use compact formatting for the template.
528+
501529
#### Returns
502530

503531
#### Returns
@@ -513,6 +541,10 @@ string The result of the Notecard request.
513541
`public def `[`serialReset`](#namespacenotecard_1_1notecard_1aa1badb3c10bdc0321b9a556e8cd49148)`(port)` | Send a reset command to a [Notecard](#classnotecard_1_1notecard_1_1_notecard).
514542
`public def `[`serialTransaction`](#namespacenotecard_1_1notecard_1aee094fc03befdcbe4ee4a9d658d09841)`(port,req,debug)` | Perform a single write to and read from a [Notecard](#classnotecard_1_1notecard_1_1_notecard).
515543
`public def `[`serialCommand`](#namespacenotecard_1_1notecard_1af2b5752d8f67ffcebeda99511e37e7a1)`(port,req,debug)` | Perform a single write to and read from a [Notecard](#classnotecard_1_1notecard_1_1_notecard).
544+
`public def `[`GetUserAgent`](#namespacenotecard_1_1notecard_1a5f8e8f2b6a9f7c5e4e6b2f9f8a9d6e7c)`()` | Returns the User Agent String for the host.
545+
`public def `[`SetAppUserAgent`](#namespacenotecard_1_1notecard_1a4b3c2d1f6e8f7a9c0e5d6b8f7c5e4e6b)`(app_user_agent)` | Sets the User Agent info for the app.
546+
`public def `[`UserAgentSent`](#namespacenotecard_1_1notecard_1a7c5e4e6b2f9f8a9d6e7c5f8e8f7a9c0)`()` | Returns true if the User Agent has been sent to the Notecard.
547+
`public def `[`SetTransactionPins`](#namespacenotecard_1_1notecard_1a9c0e5d6b8f7c5e4e6b2f9f8a9d6e7c5)`(rtx_pin,ctx_pin)` | Sets the pins used for RTX and CTX.
516548
`class `[`notecard::notecard::Notecard`](#classnotecard_1_1notecard_1_1_notecard) | Base [Notecard](#classnotecard_1_1notecard_1_1_notecard) class.
517549
`class `[`notecard::notecard::OpenI2C`](#classnotecard_1_1notecard_1_1_open_i2_c) | [Notecard](#classnotecard_1_1notecard_1_1_notecard) class for I2C communication.
518550
`class `[`notecard::notecard::OpenSerial`](#classnotecard_1_1notecard_1_1_open_serial) | [Notecard](#classnotecard_1_1notecard_1_1_notecard) class for Serial communication.
@@ -535,6 +567,35 @@ Perform a single write to and read from a [Notecard](#classnotecard_1_1notecard_
535567

536568
Perform a single write to and read from a [Notecard](#classnotecard_1_1notecard_1_1_notecard).
537569

570+
#### `public def `[`GetUserAgent`](#namespacenotecard_1_1notecard_1a5f8e8f2b6a9f7c5e4e6b2f9f8a9d6e7c)`()`
571+
572+
Returns the User Agent String for the host.
573+
574+
#### Returns
575+
string The User Agent string.
576+
577+
#### `public def `[`SetAppUserAgent`](#namespacenotecard_1_1notecard_1a4b3c2d1f6e8f7a9c0e5d6b8f7c5e4e6b)`(app_user_agent)`
578+
579+
Sets the User Agent info for the app.
580+
581+
#### Parameters
582+
* `app_user_agent` The User Agent string for the app.
583+
584+
#### `public def `[`UserAgentSent`](#namespacenotecard_1_1notecard_1a7c5e4e6b2f9f8a9d6e7c5f8e8f7a9c0)`()`
585+
586+
Returns true if the User Agent has been sent to the Notecard.
587+
588+
#### Returns
589+
boolean True if the User Agent has been sent.
590+
591+
#### `public def `[`SetTransactionPins`](#namespacenotecard_1_1notecard_1a9c0e5d6b8f7c5e4e6b2f9f8a9d6e7c5)`(rtx_pin,ctx_pin)`
592+
593+
Sets the pins used for RTX and CTX.
594+
595+
#### Parameters
596+
* `rtx_pin` The Ready to Transact pin.
597+
* `ctx_pin` The Clear to Transact pin.
598+
538599
# class `notecard::notecard::Notecard`
539600

540601
Base [Notecard](#classnotecard_1_1notecard_1_1_notecard) class.
@@ -659,4 +720,195 @@ Initialize the [Notecard](#classnotecard_1_1notecard_1_1_notecard) before a rese
659720

660721
Ensure that the passed-in card is a Notecard.
661722

662-
Generated by [Moxygen](https://sourcey.com/moxygen)
723+
# namespace `notecard::binary_helpers`
724+
725+
## Summary
726+
727+
Members | Descriptions
728+
--------------------------------|---------------------------------------------
729+
`public def `[`get_binary_length`](#namespacenotecard_1_1binary__helpers_1a1e625660366b3766ec9efa8270a7f5bb)`(card)` | Get the length of the decoded binary data store.
730+
`public def `[`reset_binary`](#namespacenotecard_1_1binary__helpers_1a660dda3f8fa6f9afff52e0a3be6bef84)`(card)` | Reset the binary data store.
731+
`public def `[`binary_get`](#namespacenotecard_1_1binary__helpers_1ad7a4c296382c14a8efb54278c127d73b)`(card,offset,length)` | Get binary data from the Notecard.
732+
`public def `[`binary_put`](#namespacenotecard_1_1binary__helpers_1a591ece0048b58f38acf22d97a533577f)`(card,data,offset,length)` | Put binary data to the Notecard.
733+
734+
## Members
735+
736+
#### `public def `[`get_binary_length`](#namespacenotecard_1_1binary__helpers_1a1e625660366b3766ec9efa8270a7f5bb)`(card)`
737+
738+
Get the length of the decoded binary data store.
739+
740+
#### Parameters
741+
* `card` The current Notecard object.
742+
743+
#### Returns
744+
int The length of the binary data store.
745+
746+
#### `public def `[`reset_binary`](#namespacenotecard_1_1binary__helpers_1a660dda3f8fa6f9afff52e0a3be6bef84)`(card)`
747+
748+
Reset the binary data store.
749+
750+
#### Parameters
751+
* `card` The current Notecard object.
752+
753+
#### Returns
754+
string The result of the Notecard request.
755+
756+
#### `public def `[`binary_get`](#namespacenotecard_1_1binary__helpers_1ad7a4c296382c14a8efb54278c127d73b)`(card,offset,length)`
757+
758+
Get binary data from the Notecard.
759+
760+
#### Parameters
761+
* `card` The current Notecard object.
762+
* `offset` The offset to start reading from.
763+
* `length` The number of bytes to read.
764+
765+
#### Returns
766+
bytearray The binary data.
767+
768+
#### `public def `[`binary_put`](#namespacenotecard_1_1binary__helpers_1a591ece0048b58f38acf22d97a533577f)`(card,data,offset,length)`
769+
770+
Put binary data to the Notecard.
771+
772+
#### Parameters
773+
* `card` The current Notecard object.
774+
* `data` The binary data to write.
775+
* `offset` The offset to start writing at.
776+
* `length` The number of bytes to write.
777+
778+
#### Returns
779+
string The result of the Notecard request.
780+
781+
# namespace `notecard::cobs`
782+
783+
## Summary
784+
785+
Members | Descriptions
786+
--------------------------------|---------------------------------------------
787+
`public def `[`cobs_encode`](#namespacenotecard_1_1cobs_1a1e625660366b3766ec9efa8270a7f5bb)`(data,eop)` | Encode a bytearray using COBS.
788+
`public def `[`cobs_decode`](#namespacenotecard_1_1cobs_1a660dda3f8fa6f9afff52e0a3be6bef84)`(data,eop)` | Decode a COBS-encoded bytearray.
789+
790+
## Members
791+
792+
#### `public def `[`cobs_encode`](#namespacenotecard_1_1cobs_1a1e625660366b3766ec9efa8270a7f5bb)`(data,eop)`
793+
794+
Encode a bytearray using COBS.
795+
796+
#### Parameters
797+
* `data` The data to encode.
798+
* `eop` The end-of-packet marker.
799+
800+
#### Returns
801+
bytearray The encoded data.
802+
803+
#### `public def `[`cobs_decode`](#namespacenotecard_1_1cobs_1a660dda3f8fa6f9afff52e0a3be6bef84)`(data,eop)`
804+
805+
Decode a COBS-encoded bytearray.
806+
807+
#### Parameters
808+
* `data` The data to decode.
809+
* `eop` The end-of-packet marker.
810+
811+
#### Returns
812+
bytearray The decoded data.
813+
814+
# namespace `notecard::crc32`
815+
816+
## Summary
817+
818+
Members | Descriptions
819+
--------------------------------|---------------------------------------------
820+
`public def `[`crc32`](#namespacenotecard_1_1crc32_1a1e625660366b3766ec9efa8270a7f5bb)`(data)` | Compute the CRC32 checksum of data.
821+
822+
## Members
823+
824+
#### `public def `[`crc32`](#namespacenotecard_1_1crc32_1a1e625660366b3766ec9efa8270a7f5bb)`(data)`
825+
826+
Compute the CRC32 checksum of data.
827+
828+
#### Parameters
829+
* `data` The data to compute the checksum for.
830+
831+
#### Returns
832+
int The CRC32 checksum.
833+
834+
# namespace `notecard::gpio`
835+
836+
## Summary
837+
838+
Members | Descriptions
839+
--------------------------------|---------------------------------------------
840+
`class `[`notecard::gpio::GPIO`](#classnotecard_1_1gpio_1_1_g_p_i_o) | Base GPIO class.
841+
`class `[`notecard::gpio::CircuitPythonGPIO`](#classnotecard_1_1gpio_1_1_circuit_python_g_p_i_o) | CircuitPython GPIO implementation.
842+
`class `[`notecard::gpio::MicroPythonGPIO`](#classnotecard_1_1gpio_1_1_micro_python_g_p_i_o) | MicroPython GPIO implementation.
843+
`class `[`notecard::gpio::RaspberryPiGPIO`](#classnotecard_1_1gpio_1_1_raspberry_pi_g_p_i_o) | Raspberry Pi GPIO implementation.
844+
845+
# namespace `notecard::md5`
846+
847+
## Summary
848+
849+
Members | Descriptions
850+
--------------------------------|---------------------------------------------
851+
`public def `[`md5`](#namespacenotecard_1_1md5_1a1e625660366b3766ec9efa8270a7f5bb)`(data)` | Compute the MD5 hash of data.
852+
`public def `[`hexdigest`](#namespacenotecard_1_1md5_1a660dda3f8fa6f9afff52e0a3be6bef84)`(digest)` | Convert a binary digest to hexadecimal.
853+
854+
## Members
855+
856+
#### `public def `[`md5`](#namespacenotecard_1_1md5_1a1e625660366b3766ec9efa8270a7f5bb)`(data)`
857+
858+
Compute the MD5 hash of data.
859+
860+
#### Parameters
861+
* `data` The data to hash.
862+
863+
#### Returns
864+
bytearray The MD5 hash.
865+
866+
#### `public def `[`hexdigest`](#namespacenotecard_1_1md5_1a660dda3f8fa6f9afff52e0a3be6bef84)`(digest)`
867+
868+
Convert a binary digest to hexadecimal.
869+
870+
#### Parameters
871+
* `digest` The binary digest.
872+
873+
#### Returns
874+
string The hexadecimal representation.
875+
876+
# namespace `notecard::timeout`
877+
878+
## Summary
879+
880+
Members | Descriptions
881+
--------------------------------|---------------------------------------------
882+
`public def `[`start_timeout`](#namespacenotecard_1_1timeout_1a1e625660366b3766ec9efa8270a7f5bb)`()` | Start a timeout interval.
883+
`public def `[`has_timed_out`](#namespacenotecard_1_1timeout_1a660dda3f8fa6f9afff52e0a3be6bef84)`(start,timeout_secs)` | Check if a timeout has occurred.
884+
885+
## Members
886+
887+
#### `public def `[`start_timeout`](#namespacenotecard_1_1timeout_1a1e625660366b3766ec9efa8270a7f5bb)`()`
888+
889+
Start a timeout interval.
890+
891+
#### Returns
892+
float The start time.
893+
894+
#### `public def `[`has_timed_out`](#namespacenotecard_1_1timeout_1a660dda3f8fa6f9afff52e0a3be6bef84)`(start,timeout_secs)`
895+
896+
Check if a timeout has occurred.
897+
898+
#### Parameters
899+
* `start` The start time.
900+
* `timeout_secs` The timeout in seconds.
901+
902+
#### Returns
903+
boolean True if the timeout has occurred.
904+
905+
# namespace `notecard::transaction_manager`
906+
907+
## Summary
908+
909+
Members | Descriptions
910+
--------------------------------|---------------------------------------------
911+
`class `[`notecard::transaction_manager::TransactionManager`](#classnotecard_1_1transaction__manager_1_1_transaction_manager) | Manages transactions with the Notecard.
912+
`class `[`notecard::transaction_manager::NoOpTransactionManager`](#classnotecard_1_1transaction__manager_1_1_no_op_transaction_manager) | No-op transaction manager.
913+
914+
Generated by [Moxygen](https://sourcey.com/moxygen)

0 commit comments

Comments
 (0)