# [−][src]Module app::app_network

Transmit sensor data to a CoAP server like thethings.io. The CoAP payload will be encoded as JSON. The sensor data will be transmitted over NB-IoT. Note that we are using a patched version of apps/my_sensor_app/src/vsscanf.c that fixes response parsing bugs. The patched file must be present in that location. This is the Rust version of `https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/rust-nbiot/apps/my_sensor_app/OLDsrc/network.c`

## Functions

send_sensor_data | Compose a CoAP JSON message with the Sensor Key (field name) and Value in `val` and send to the CoAP server. The message will be enqueued for transmission by the CoAP / OIC Background Task so this function will return without waiting for the message to be transmitted. Return `Ok()` if successful, `SYS_EAGAIN` if network is not ready yet. For the CoAP server hosted at thethings.io, the CoAP payload should be encoded in JSON like this:

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)