Creating UWP test app for NHS3100

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating UWP test app for NHS3100

872 Views
sergio_neves
Contributor I

Hi, I'm creating a UWP test app for NHS3100. The tag is running the default firmware TLogger.

I'm working on Visual Studio 2017, with C# and using proximity APIs for NFC NdefLibrary and NdefLibraryExtension.
I'm already able to read the NHS3100 tag.

Now I want to send a command to read current temperature. How or what is the command to do that?

Any help will be appreciated.

Thanks,

0 Kudos
1 Reply

621 Views
driesmoors
NXP Employee
NXP Employee

Hi,

All communication is done using NDEF messages containing 1 MIME record. The payload in a MIME record sent from host to target is called a 'command'; the data prepared by the NHS3100 ARM and stored in the NFC shared memory for the host to read out - overwriting the 'command' - is called 'response'.


The payload is to be formatted according to the documentation found in the SDK under docs/FirmwareDevelopmentDocumentation/index.html, Modules » msg: Message Handler and Applications » tlogger: Temperature Logger Demo Application » Message Handler Module » Protocol Extension.

In short:

  • the first byte indicates the message ID: for each message id a command and a response can be created
  • the second byte is mostly reserved and currently serves as an extra check to discriminate commands from responses.
  • the third and subsequent bytes - if present - are specific for each different message ID.
  • one command may trigger the creation of multiple responses; yet only one response will be made available immediately. To fetch subsequent responses, a special command is to be issued, which will then retrieve the oldest non-immediate response. Check the documentation for each message ID to know what can be expected.

Currently, all demo applications use this simple communication scheme to exchange data between host and target. There are a number of pre-defined message IDs; and each application can easily add its own application specific messages. e.g. the tlogger firmware added a MEASURETEMPERATURE (50h) message, which the tadherence firmware lacks.

Examples:

  • The command to retrieve version information: 02h 00h
  • When running tlogger firmware:
    • The command to retrieve the current temperature: 50h 00h 07h (7 -> 12 bits resolution)
    • The immediate response: 50h 01h 00h 00h 00h 00h (00000000h -> command accepted, measurement in progress)
    • The command to fetch the second response: 01h 00h
    • The non-immediate response: 50h 01h 00h 00h 00h 00h 09h 01h (0109h -> 265 decimal -> 26.5 degrees Celsius)

Have a thorough read in the doxygen generated documentation referred to above. When this and the documentation still leave you with questions, just ask.

Best,

0 Kudos