cameraboard.h

Constants

IMG_COLOR_YUV_422specifies planar 422 YUV colorspace
IMG_COLOR_GBR_422specifies planar 422 RGB colorspace, in the order of GBR (not RGB)
IMG_RES_VGAspecifies VGA 640x480 resolution
IMG_RES_QVGAspecifies QVGA 320x240 resolution
IMG_RES_QQVGAspecifies QQVGA 160x120 resolution

Structs

cameraboard
Used to access the camera image
imgarray of image data
img_widthimage width
img_heightimage height
img_lengthequal to image_width * img_height * 2
img_timetimestamp of captured frame

Functions

camera_set_autoexp
sets the auto exposure of the camera
xboolean value determining whether auto exposure is on
cameraboard_open
returns a cameraboard struct used to access the data of the cameraboard.
img_color0sets the initial colorspace, using the IMG_COLOR constants
img_res0sets the initial resolution, using the IMG_RES constants
auto_exposuresets whether auto exposure is initially turned on/off
cameraboard_close
closes cameraboard
camera_capture_frame
captures a frame from the camera. The cameraboard struct can be used to access the new frame. retuns 0 if successful
camera_calibrate_exp
turns on the auto exposure and allows the camera time to adjust to lighting conditions
calibration_timetime in seconds to calibrate
auto_exp_onwhether auto exposure is left on at the end of calibration
verboseprints a countdown
cbpkt_send
sends a CB packet. returns 0 if successful, 1 if failed
typeCB packet type
destdestination mote ID
payloaddata to be sent
lengthlength of payload data
cbpkt_rcv
receives a CB packet. returns 1 and populates input pointers if there is a packet to be received. returns 0 if there is no packet to be received
typeCB packet type of incoming packet
src_id_actualactual source id of incoming packet. this is the id of the originating mote in a multihop network (not the id of the last hop)
payloadincoming data
lengthlength of payload data
outqueue_is_full
outgoing packets are put in a queue for radio transmission. returns 1 if the queue is full, 0 otherwise
inqueue_is_empty
incoming packets are put in a queue to be read. returns 1 if the queue is full, 0 otherwise
cameraboard_sync_time
syncs the cameraboard time with the attached mote's time
cameraboard_get_time
returns the global time of time synced motes. returns 0 if time was never synced
write_binary_image
writes an image to a binary uncompressed file. The contents are a dump of the image array data. The filename is a concatenation of the prefix and count (set to 4 0-filled digits)
bufimage array
image_widthwidth of image
image_heightheight of image
fnfilename string
colorspecifies whether a color image should be written or grayscale. For color images buf should be of length image_width * image_height * 2. For grayscale images buf should be of length image_width * image_height.
write_jpeg_image
writes an image to a JPEG file. The filename is a concatenation of the prefix and count (set to 4 0-filled digits) with a suffix of ".jpg"
bufimage array
image_widthwidth of image
image_heightheight of image
fnfilename string
colorspecifies whether a color image should be written or grayscale. For color images buf should be of length image_width * image_height * 2. For grayscale images buf should be of length image_width * image_height.
qualityJPEG quality, from 0-100
get_cbprintf_group
returns boolean value whether the specified cbprintf group is turned on or off
groupnumgroup number
set_cbprintf_group
turns the specified cbprintf group on or off
groupnumgroup number
valueboolean indicating whether group is on or off
cbprintf
wireless printf for sending messages (currently only to server), useful for sending debug messages. Input paramaters are exactly like the printf function, with an additional first paramater indicating which group number to print to. There are a total of 8 groups, numbered 0-7, each of which may be turned on or off. This allows messages to be grouped into 8 categories for more organized and powerful debugging
groupnumgroup number
send_file
wireless file transfer (currently only to server)
destdestination mote ID
fnname/path of file to send