Skip to content

Add back wrongly removed '\n' K-V pair sent to the device #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Key-value protocol was developed and is used to provide communication layer betw
## Design draft
* Simple key-value protocol is introduced. It is used to communicate between DUT and host. Protocol main features:
* Protocol introduced is master-slave protocol, where master is host and slave is device under test.
* Transport layer consist of simple ```{{KEY;VALUE}}}``` messages sent by slave (DUT). Both key and value are strings with allowed character set limitations (to simplify parsing and protocol parser itself).
* Transport layer consist of simple ```{{ KEY ; VALUE }} \n``` text messages sent by slave (DUT). Both key and value are strings with allowed character set limitations (to simplify parsing and protocol parser itself). Message ends with required by DUT K-V parser `\n` character.
* DUT always (except for handshake phase) initializes communication by sending key-value message to host.
* To avoid miscommunication between master and slave simple handshake protocol is introduces:
* Master (host) sends sync packet: ```{{__sync;UUID-STRING}}}``` with message value containing random UUID string.
Expand Down
10 changes: 8 additions & 2 deletions mbed_host_tests/host_tests_conn_proxy/conn_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ def __init__(self, name):
self.logger = HtrunLogger(name)

def write_kv(self, key, value):
kv_buff = "{{%s;%s}}"% (key, value)
"""! Forms and sends Key-Value protocol message.
@details On how to parse K-V sent from DUT see KiViBufferWalker::KIVI_REGEX
On how DUT sends K-V please see greentea_write_postamble() function in greentea-client
@return Returns buffer with K-V message sent to DUT
"""
# All Key-Value messages ends with newline character
kv_buff = "{{%s;%s}}"% (key, value) + '\n'
self.write(kv_buff)
self.logger.prn_txd(kv_buff)
self.logger.prn_txd(kv_buff.rstrip())
return kv_buff

def read(self, count):
Expand Down