brought to you by Deparment of Optics & Acoustics

the callback reference

This page contains information relevant to the firmware v1.2.2, build 208.

Callback messages are sent automatically as soon as a client connects to the camera's port 5677. Data are UTF-8 encoded strings, each event on its line, ending with CR LF and a null character. The callback name is enclosed in square brackets, followed by parameter(s) separated by space.

[CallbackName] param1 param2 ...\r\n\0

The following messages were observed, in alphabetic order:

  1. AllPicturesDeleted
  2. CreativeModeChanged
  3. HeartbeatTick
  4. IsoSensitivityChanged
  5. LikedChanged
  6. NeutralDensityFilterChanged
  7. NewPictureAvailable
  8. PictureDeleted
  9. SelfTimerTick
  10. ShutterPressed
  11. ShutterSpeedChanged
  12. ZoomLevelChanged

The following messages do not seem to be currently enabled:

core messages

HeartbeatTick

Generated automatically approximately every 100 ms if no other callback occurs.

Syntax:

[HeartbeatTick] tick

Parameters:

parametertypedescription
tickstringalways 'tick'

Remarks:

This message is used as a watchdog to detect whether camera is still connected and responding. Sufficient amount of other messages will prevent this message coming, so the watchdog should be reset on any message received.

Examples:

[HeartbeatTick] tick\r\n\0

SelfTimerTick

Occurs every second during self timer count-down.

Syntax:

[SelfTimerTick] state

Parameters:

parametervaluesdescription
stateinteger
- or -
string
number of seconds remaining to trigger the shutter
- or -
'Canceled' when the user cancels the timer

Remarks:

The SelfTimerTick sequence ends either with ShutterPressed callback or cancelled.

Examples:

[SelfTimerTick] 2\r\n\0
[SelfTimerTick] Canceled\r\n\0

ShutterPressed

Occurs immediately after shutter is triggered.

Syntax:

[ShutterPressed] CLICK

Parameters:

parametertypedescription
CLICKstringalways 'CLICK'

Remarks:

The shutter can be triggered either manually by taking a picture, or using the self-timer. This callback does not distinguish between the two.

Examples:

[ShutterPressed] CLICK\r\n\0

NewPictureAvailable

Occurs when a picture taken is rendered and becomes available for download.

Syntax:

[NewPictureAvailable] id

Parameters:

parametertypedescription
idstringthe id of picture available

Remarks:

A picture is not ready immediately when it is taken, it needs to be processed by the camera engine first. The id can be used to download the picture from the camera.

Examples:

[NewPictureAvailable] sha1-1234567890123456789012345678901234567890\r\n\0

picture management

LikedChanged

Occurs when a user marks or unmarks a picture as a favorite.

Syntax:

[LikedChanged] id liked

Parameters:

parametertypedescription
idstringthe id of picture available
likedinteger'1' if marked as favorite
- or -
'0' if unmarked as favorite

Remarks:

A picture is marked/unmarked as favorite by tapping the star icon.

Examples:

[LikedChanged] sha1-1234567890123456789012345678901234567890 1\r\n\0

PictureDeleted

Occurs when a picture is deleted from the camera.

Syntax:

[PictureDeleted] id

Parameters:

parametertypedescription
idstringthe id of picture deleted

Examples:

[PictureDeleted] sha1-1234567890123456789012345678901234567890\r\n\0

AllPicturesDeleted

Occurs when all pictures are deleted from the camera at once.

Syntax:

[AllPicturesDeleted] all deleted

Parameters:

parametertypedescription
allstringalways 'all'
deletedstringalways 'deleted'

Remarks:

This message is sent by the delete all command in the settings menu, regardless of the actual number of pictures deleted. Deleting the last picture individually does not send this message.

Examples:

[AllPicturesDeleted] all deleted\r\n\0

taking pictures

ZoomLevelChanged

Occurs when camera zoom is changed.

Syntax:

[ZoomLevelChanged] zoom

Parameters:

parametertypedescription
zoomfloatthe zoom level, ranging '1.0' to '8.0'

Remarks:

This message is sent continuously as user swipes a finger to change the zoom factor, except when the General Control Dock is shown. In that case, the message is sent only once when the dock gets hidden again.

The current shooting mode determines the possible range of zoom level. In standard mode, the range is '1.0' to '5.4' (the display shows 5.5x). In the Creative Mode, the zoom range is extended up to '8.0'. Switching between Everyday Mode and Creative Mode effectively changes the current zoom level, however, this does not result in any message.

Examples:

[ZoomLevelChanged] 2.0\r\n\0

CreativeModeChanged

Occurs when the current shooting mode changes.

Syntax:

[CreativeModeChanged] status

Parameters:

parametertypedescription
statusinteger'1' if the new mode is Creative Mode
- or -
'0' if the new mode is Everyday Mode

Examples:

[CreativeModeChanged] 1\r\n\0

ShutterSpeedChanged

Occurs when the shutter speed setting changes.

Syntax:

[ShutterSpeedChanged] seconds

Parameters:

parametertypedescription
secondsfloatthe number of seconds the shutter is open
- or -
'0.000000' if shutter speed is set to automatic

Remarks:

This message occurs when user changes the Shutter Speed under manual controls. The callback happens only at the moment the Shutter Speed setting is opened (with current settings) and closed (with new settings), i.e. not as user continuously changes the setting. Changes due to automatic setting do not result in callback.

The shutter speed can be set manually to 8, 4, 6.4, 5, 4, 3.2, 2.5, 2, 1.6, 1.25, 1, 1/1.25, 1/1.6, 1/2, 1/2.5, 1/3.2, 1/4, 1/5, 1/6.4, 1/8, 1/10, 1/12, 1/15, 1/20, 1/25, 1/30, 1/40, 1/50, 1/60, 1/80, 1/100, 1/125, 1/160, 1/200 and 1/250 seconds. However, note that the automatic setting is not limited to these values and when opening the Shutter Speed setting with an automatic value, it can be any arbitrary number.

Switching to automatic control resets the shutter speed setting to automatic and causes this message to be sent, as soon as the checkbox in the menu is unchecked. Switching to manual control keeps the settings automatic, so no message sent in this case.

Examples:

[ShutterSpeedChanged] 0.000000\r\n\0
[ShutterSpeedChanged] 0.008158\r\n\0
[ShutterSpeedChanged] 0.008000\r\n\0

IsoSensitivityChanged

Occurs when the ISO sensitivity setting changes.

Syntax:

[IsoSensitivityChanged] value

Parameters:

parametertypedescription
valuefloatthe ISO setting divided by 50.0
- or -
'0.000000' if ISO sensitivity is set to automatic

Remarks:

This message occurs when user changes the ISO Sensitivity under manual controls. The callback happens only at the moment the ISO Sensitivity setting is opened (with current settings) and closed (with new settings), i.e. not as user continuously changes the setting. Changes due to automatic setting do not result in callback.

The ISO sensitivity can be set manually to 3200, 2500, 2000, 1600, 1250, 1000, 800, 640, 500, 400, 320, 250, 200, 160, 125, 100, 80 and 75 (corresponding to values 64.0 to 1.5). However, note that the automatic setting is not limited to these values and when opening the ISO Sensitivity setting with an automatic value, it can be any arbitrary number. Also note that the ISO Sensitivity of 75 is incorrectly reported as 80 on the display.

Switching to automatic control resets the ISO Sensitivity setting to automatic and causes this message to be sent, as soon as the checkbox in the menu is unchecked. Switching to manual control keeps the settings automatic, so no message in this case.

Examples:

[IsoSensitivityChanged] 0.000000\r\n\0
[IsoSensitivityChanged] 56.509144\r\n\0
[IsoSensitivityChanged] 64.000000\r\n\0

NeutralDensityFilterChanged

Occurs when the neutral density filter is turned on or off.

Syntax:

[NeutralDensityFilterChanged] status

Parameters:

parametertypedescription
statusinteger'1' if the filter was turned on
- or -
'0' if the filter was turned off

Remarks:

This message occurs when user changes the ND filter setting under manual controls. The callback happens only at the moment the user taps the setting on the display. Changes due to automatic setting do not result in callback (which includes switching to automatic control or setting either Shutter Speed or ISO Sensitivity to Auto).

Examples:

[NeutralDensityFilterChanged] 1\r\n\0

the communicator

You can easily monitor callbacks from your camera now — use the communicator.

Disclaimer: Jan Kučera and miloush.net are not affiliated with or endorsed by Lytro, Inc.