QR Code Scanner

This module manages the entire process of capturing, decoding and getting the device parameters from a QR code.

Summary

It also saves and loads the device parameters to and from the external storage.

Functions

CardboardQrCode_destroy(const uint8_t *encoded_device_params)
void
Releases memory used by the provided encoded_device_params array.
CardboardQrCode_getSavedDeviceParams(uint8_t **encoded_device_params, int *size)
void
Gets currently saved devices parameters.
CardboardQrCode_scanQrCodeAndSaveDeviceParams()
void
Scans a QR code and saves the encoded device parameters.

Functions

CardboardQrCode_destroy

void CardboardQrCode_destroy(
  const uint8_t *encoded_device_params
)

Releases memory used by the provided encoded_device_params array.

Details
Parameters
encoded_device_params
The device parameters serialized using cardboard_device.proto.

CardboardQrCode_getSavedDeviceParams

void CardboardQrCode_getSavedDeviceParams(
  uint8_t **encoded_device_params,
  int *size
)

Gets currently saved devices parameters.

This function allocates memory for the parameters, so it must be released using CardboardQrCode_destroy.

Details
Parameters
encoded_device_params
Reference to the device parameters serialized using cardboard_device.proto.
size
Size in bytes of encoded_device_params.

CardboardQrCode_scanQrCodeAndSaveDeviceParams

void CardboardQrCode_scanQrCodeAndSaveDeviceParams()

Scans a QR code and saves the encoded device parameters.