Documentation
¶
Index ¶
Constants ¶
const TypeAssets = "ACD9DFE7-948D-43D0-A205-D2F6F368541D"
TypeAssets is the uuid of the Assets characteristic
const TypeCameraControl = "19BDAD9E-6102-48D5-B413-3F11253706AE"
const TypeDeleteAssets = "3982EB69-1ECE-463E-96C6-E5A7DF2FA1CD"
TypeDeleteAssets is the uuid of the DeleteAssets characteristic
const TypeGetAsset = "6A6C39F5-67F0-4BE1-BA9D-E56BD27C9606"
const TypeTakeSnapshot = "E8AEE54F-6E4B-46D8-85B2-FECE188FDB08"
Variables ¶
var RefDate = time.Date(2019, 4, 1, 0, 0, 0, 0, time.UTC)
RefDate represents the reference date used to generate asset ids. Short ids are prefered and therefore we use 1st April 2019 as the reference date.
Functions ¶
Types ¶
type Assets ¶
type Assets struct {
*characteristic.Bytes
}
Assets contains a list of assets encoded as JSON. A valid JSON looks like this. `{"assets":[{"id":"1.jpg", "date":"2019-04-01T10:00:00+00:00"}]}` Writing to this characteristic is discouraged.
type AssetsMetadataResponse ¶
type AssetsMetadataResponse struct {
Assets []CameraAssetMetadata `json:"assets"`
}
type CameraAssetMetadata ¶
type CameraControl ¶
type CameraControl struct { TakeSnapshot *TakeSnapshot Assets *Assets GetAsset *GetAsset DeleteAssets *DeleteAssets CameraSnapshotReq func(width, height uint) (*image.Image, error) // contains filtered or unexported fields }
func NewCameraControl ¶
func NewCameraControl() *CameraControl
func (*CameraControl) SetupWithDir ¶
func (cc *CameraControl) SetupWithDir(dir string)
type DeleteAssets ¶
type DeleteAssets struct {
*characteristic.Bytes
}
DeleteAssets is used to handle request to delete assets. A valid JSON looks like this. `{"ids":["1.jpg"]}` Reading the value of this characteristic is discouraged.
func NewDeleteAssets ¶
func NewDeleteAssets() *DeleteAssets
type DeleteAssetsRequest ¶
type DeleteAssetsRequest struct {
IDs []string `json:"ids"`
}
type GetAsset ¶
type GetAsset struct {
*characteristic.Bytes
}
GetAsset is used to get the raw data of an asset. After writing a valid JSON to this characteristic, the characteristic value will be the raw data of the requested asset. A valid JSON looks like this. `{"id":"1.jpg","width":320,"height":240}`
func NewGetAsset ¶
func NewGetAsset() *GetAsset
type GetAssetRequest ¶
type TakeSnapshot ¶
type TakeSnapshot struct {
*characteristic.Bool
}
TakeSnapshot is used to take a snapshot. After writing `true` to this characteristic, a snapshot is taked and persisted on disk.
func NewTakeSnapshot ¶
func NewTakeSnapshot() *TakeSnapshot