summaryrefslogtreecommitdiff
path: root/include/device_proto.h
Commit message (Collapse)AuthorAge
* Skip checking packet's CRCSzczepan Zalega2017-10-10
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Make additional retries for longer running commandsSzczepan Zalega2017-10-10
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Set lower maximum between-sending delaySzczepan Zalega2017-09-20
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Decrease busy-delay countSzczepan Zalega2017-09-20
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Correct mutex placementSzczepan Zalega2017-09-20
| | | | | | Move mutex from template instantation to single compilation unit to make it work as desired Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Do not make longer waiting than 500ms on iterationSzczepan Zalega2017-09-20
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Show warning message about invalid incoming packet's CRCSzczepan Zalega2017-09-20
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Log accepting responses with invalid CRCSzczepan Zalega2017-05-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoringSzczepan Zalega2017-05-13
| | | | | | | Remove doubled implementation Remove clutter from DEBUG log level Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Do not log volatile dataSzczepan Zalega2017-05-13
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Use separate exception for wrong receiving packet's CRCSzczepan Zalega2017-03-27
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Dynamically increase delay between retries on busy statusSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Use own exception types instead of general runtime_errorSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add TODO commentSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Build debug-log-free library for increased securitySzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Correct device countersSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Adjust for compilation on Visual Studio 2017Szczepan Zalega2017-03-11
| | | | Building works however tests are not. Possibly linking with original hidapi solution would work.
* Count all busy statusSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Disable early device disconnection on communication errorSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Allow device to reply 10 times with busy status in a trySzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Make statistics about device's connectionSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Disconnect device as soon as the communication issue appearsSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Throw before communicating with device if it is not initializedSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Pass devices shared pointer to methods instead of refSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Decrease retry count to 20Szczepan Zalega2017-03-11
| | | | | | Update log message to be more readable Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add lock_guard for complete send-receive cycleSzczepan Zalega2017-03-11
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Remove unused inttypesSzczepan Zalega2017-01-09
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Treat LongOperationException as CommandFailed and handle it transparentlySzczepan Zalega2016-11-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring - named magic numbers (2)Szczepan Zalega2016-11-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring - named magic numbersSzczepan Zalega2016-11-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Handle busy_progressbar device statusSzczepan Zalega2016-11-26
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Fix compilation G++6 errorSzczepan Zalega2016-11-18
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Fix compilation warning and error under G++ - use union to reach uint8 ↵Szczepan Zalega2016-10-22
| | | | | | slot_counter for NK Storage. Fixes #46 Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Add all devices' and commands' statusesSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring: replacing magic numbersSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring: variables names unificationSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring: removing disambiguity from device constantsSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring: replacing magic numbersSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring: c++ castsSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code reformatSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code refactoring: rename - disambiguate receiving counter from sendingSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Resend outgoing packet on invalid crc and when used all receiving retriesSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Make packet valid when its crc is not equal 0Szczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Handle NK Storage status sent on Storage commandsSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Code reformatSzczepan Zalega2016-10-19
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Moving to shared ptr for deviceSzczepan Zalega2016-08-09
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Clearing whole response packet instead of only payload part #20Szczepan Zalega2016-08-08
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Clear incoming packets as soon they meet their lifetime endv0.9Szczepan Zalega2016-08-05
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Clear outgoing packet as soon as command response is receivedSzczepan Zalega2016-08-05
| | | | Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
* Throw exception when retry count is exhausted. Show retry counts in debug ↵Szczepan Zalega2016-08-05
| | | | | | messages Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>