Skip to main content

server.bless(testSuccess, callback)

Binds a production device to application firmware and registers a function to be called when the blessing attempt completes

Availability

Device
Available for use in Factory Firmware only

Parameters

Name Type Description
testSuccess Bool Whether the device has passed (true) or failed (false) your tests, and so whether it should be blessed
callback Function Function to be called on completion of the blessing process

Returns

Nothing

Description

This method can only be used only Electric Imp customers’ production lines as part of the factory testing process. It is the means by which an imp-based device under test (DUT) is blessed: the point at which Electric Imp impCloud™ servers know that the unit should be assigned to its appointed Production Device Group and sent the application firmware that has been deployed to that Group.

The first argument should be true or false, representing the success or failure of the manufacturer’s own tests of the hardware.

If the testSuccess value is true, the blessing request is sent to the server (and the server.bless() function returns). When the server responds, the function passed into the callback parameter is executed and passed a single argument: true or false, according to whether the blessing request was successful or failed. The DUT’s LED is now turned solid green for success, or solid red for failure.

If the testSuccess value is false, the failure is logged at the server and the DUT’s LED is turned on solid red to indicate failure. The blessing completion callback is still made, but with false passed as the callback’s argument.

This callback can be used for additional indications of test pass or fail, for example using connected hardware or a beep alert.

Module-specific Notes

imp001

imp001 card blessing — manually putting an imp001 ‘factory imp’ into each DUT to test and bless the DUT — is no longer supported. When called on an imp001, server.bless() will return immediately and pass the failure condition into the callback function. For more information, see ‘Changes to Production Processes Under impCentral’).

Note This does not apply to imp001-based DUTs which are configured using a BlinkUp™ fixture.

Example Code

The following code provides minimal factory firmware for a Factory BlinkUp Fixture. Here, the fixture is an imp003 breakout board with an LED on pin Y. Every ten seconds the fixture will start the BlinkUp procedure automatically. The target device under test (DUT) will automatically and immediately be blessed as soon as it runs this code. The LED on the DUT (not the fixture) will turn solid green indicating pass/bless, or turn solid red indicating fail/no blessing.