Modules#

EmberAfCalendarDayScheduleEntryStruct

EmberAfCalendarDayStruct

EmberAfCalendarSpecialDayStruct

EmberAfCalendarWeekStruct

EmberAfCalendarSeasonStruct

EmberAfCalendarStruct

Calendar Common#

API and Callbacks for the Calendar Common Component.

This component provides common utility functions that are used by the client and server of the Calendar Cluster.

API#

uint8_t
emberAfPluginCalendarCommonGetCalendarById(uint32_t calendarId, uint32_t providerId)

Gets the calender by calender ID.

uint32_t
emberAfPluginCalendarCommonEndTimeUtc(const EmberAfCalendarStruct *calendar)

Get the calender end time (UTC).

bool
emberAfCalendarCommonSetCalInfo(uint8_t index, uint32_t providerId, uint32_t issuerEventId, uint32_t issuerCalendarId, uint32_t startTimeUtc, uint8_t calendarType, uint8_t *calendarName, uint8_t numberOfSeasons, uint8_t numberOfWeekProfiles, uint8_t numberOfDayProfiles)

Sets the calender info.

bool
emberAfCalendarCommonAddCalInfo(uint32_t providerId, uint32_t issuerEventId, uint32_t issuerCalendarId, uint32_t startTimeUtc, uint8_t calendarType, uint8_t *calendarName, uint8_t numberOfSeasons, uint8_t numberOfWeekProfiles, uint8_t numberOfDayProfiles)

Adds a new entry corresponding to the PublishCalendar command. Tries to handle the new entry in the following method: 1) Try to apply new data to a matching existing entry. 2) Fields such as providerId, issuerEventId, and startTime, will be used. 3) Overwrite the oldest entry (one with smallest event ID) with new information.

bool
emberAfCalendarServerSetSeasonsInfo(uint8_t index, uint8_t seasonId, EmberAfDate startDate, uint8_t weekIndex)

Set calender server season info.

bool
emberAfCalendarServerAddSeasonsInfo(uint32_t issuerCalendarId, uint8_t *seasonsEntries, uint8_t seasonsEntriesLength, uint8_t *unknownWeekIdSeasonsMask)

Add calender server season info.

bool
emberAfCalendarCommonSetDayProfInfo(uint8_t index, uint8_t dayId, uint8_t entryId, uint16_t minutesFromMidnight, uint8_t data)

Set day profile info.

bool
emberAfCalendarCommonAddDayProfInfo(uint32_t issuerCalendarId, uint8_t dayId, uint8_t *dayScheduleEntries, uint16_t dayScheduleEntriesLength)

Add day profile info.

bool
emberAfCalendarServerSetWeekProfInfo(uint8_t index, uint8_t weekId, uint8_t dayIdRefMon, uint8_t dayIdRefTue, uint8_t dayIdRefWed, uint8_t dayIdRefThu, uint8_t dayIdRefFri, uint8_t dayIdRefSat, uint8_t dayIdRefSun)

Set calender server week profile info.

bool
emberAfCalendarServerAddWeekProfInfo(uint32_t issuerCalendarId, uint8_t weekId, uint8_t dayIdRefMon, uint8_t dayIdRefTue, uint8_t dayIdRefWed, uint8_t dayIdRefThu, uint8_t dayIdRefFri, uint8_t dayIdRefSat, uint8_t dayIdRefSun)

Add calender server week profile.

bool
emberAfCalendarCommonAddSpecialDaysInfo(uint32_t issuerCalendarId, uint8_t totalNumberOfSpecialDays, uint8_t *specialDaysEntries, uint16_t specialDaysEntriesLength, uint8_t *unknownSpecialDaysMask)

Updating special days information of the specified calendar. Assumes that the value of totalNumberOfSpecialDays will match up with the information passed in between specialDaysEntries and specialDaysEntriesLength.

Enumerations#

enum
EMBER_AF_PLUGIN_CALENDAR_COMMON_FLAGS_SENT = 0x01
}

Macros#

#define
fieldLength (field)
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_INVALID_SCHEDULE_ENTRY 0xFFFF
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_INVALID_ID 0xFF
#define
EMBER_AF_PLUGIN_CALENDAR_MAX_CALENDAR_NAME_LENGTH 12
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_INVALID_INDEX 0xFF
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_MONDAY_INDEX (0)
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_SUNDAY_INDEX (6)
#define
EMBER_AF_DAYS_IN_THE_WEEK (7)
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_INVALID_CALENDAR_ID 0xFFFFFFFF
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_WILDCARD_CALENDAR_ID 0x00000000
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_WILDCARD_PROVIDER_ID 0xFFFFFFFF
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_WILDCARD_ISSUER_ID 0xFFFFFFFF
#define
EMBER_AF_PLUGIN_CALENDAR_COMMON_WILDCARD_CALENDAR_TYPE 0xFF

API Documentation#

emberAfPluginCalendarCommonGetCalendarById#

uint8_t emberAfPluginCalendarCommonGetCalendarById (uint32_t calendarId, uint32_t providerId)

Gets the calender by calender ID.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AcalendarId

Ver.: always

uint32_tN/AproviderId

Ver.: always

Returns

  • uint8_t Calender index


emberAfPluginCalendarCommonEndTimeUtc#

uint32_t emberAfPluginCalendarCommonEndTimeUtc (const EmberAfCalendarStruct * calendar)

Get the calender end time (UTC).

Parameters
TypeDirectionArgument NameDescription
const EmberAfCalendarStruct *N/Acalendar

pointer to the calender struct Ver.: always

Returns

  • uint32_t end UTC time in seconds


emberAfCalendarCommonSetCalInfo#

bool emberAfCalendarCommonSetCalInfo (uint8_t index, uint32_t providerId, uint32_t issuerEventId, uint32_t issuerCalendarId, uint32_t startTimeUtc, uint8_t calendarType, uint8_t * calendarName, uint8_t numberOfSeasons, uint8_t numberOfWeekProfiles, uint8_t numberOfDayProfiles)

Sets the calender info.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

Ver.: always

uint32_tN/AproviderId

Ver.: always

uint32_tN/AissuerEventId

Ver.: always

uint32_tN/AissuerCalendarId

Ver.: always

uint32_tN/AstartTimeUtc

Ver.: always

uint8_tN/AcalendarType

Ver.: always

uint8_t *N/AcalendarName

Ver.: always

uint8_tN/AnumberOfSeasons

Ver.: always

uint8_tN/AnumberOfWeekProfiles

Ver.: always

uint8_tN/AnumberOfDayProfiles

Ver.: always

Returns

  • bool true if success


emberAfCalendarCommonAddCalInfo#

bool emberAfCalendarCommonAddCalInfo (uint32_t providerId, uint32_t issuerEventId, uint32_t issuerCalendarId, uint32_t startTimeUtc, uint8_t calendarType, uint8_t * calendarName, uint8_t numberOfSeasons, uint8_t numberOfWeekProfiles, uint8_t numberOfDayProfiles)

Adds a new entry corresponding to the PublishCalendar command. Tries to handle the new entry in the following method: 1) Try to apply new data to a matching existing entry. 2) Fields such as providerId, issuerEventId, and startTime, will be used. 3) Overwrite the oldest entry (one with smallest event ID) with new information.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AproviderId

Ver.: always

uint32_tN/AissuerEventId

Ver.: always

uint32_tN/AissuerCalendarId

Ver.: always

uint32_tN/AstartTimeUtc

Ver.: always

uint8_tN/AcalendarType

Ver.: always

uint8_t *N/AcalendarName

Ver.: always

uint8_tN/AnumberOfSeasons

Ver.: always

uint8_tN/AnumberOfWeekProfiles

Ver.: always

uint8_tN/AnumberOfDayProfiles

Ver.: always

Returns

  • bool true if success


emberAfCalendarServerSetSeasonsInfo#

bool emberAfCalendarServerSetSeasonsInfo (uint8_t index, uint8_t seasonId, EmberAfDate startDate, uint8_t weekIndex)

Set calender server season info.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

Ver.: always

uint8_tN/AseasonId

Ver.: always

EmberAfDateN/AstartDate

Ver.: always

uint8_tN/AweekIndex

Ver.: always

Returns

  • bool true if success


emberAfCalendarServerAddSeasonsInfo#

bool emberAfCalendarServerAddSeasonsInfo (uint32_t issuerCalendarId, uint8_t * seasonsEntries, uint8_t seasonsEntriesLength, uint8_t * unknownWeekIdSeasonsMask)

Add calender server season info.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AissuerCalendarId

Ver.: always

uint8_t *N/AseasonsEntries

Ver.: always

uint8_tN/AseasonsEntriesLength

Ver.: always

uint8_t *N/AunknownWeekIdSeasonsMask

Ver.: always

Returns

  • bool true if success


emberAfCalendarCommonSetDayProfInfo#

bool emberAfCalendarCommonSetDayProfInfo (uint8_t index, uint8_t dayId, uint8_t entryId, uint16_t minutesFromMidnight, uint8_t data)

Set day profile info.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

Ver.: always

uint8_tN/AdayId

Ver.: always

uint8_tN/AentryId

Ver.: always

uint16_tN/AminutesFromMidnight

Ver.: always

uint8_tN/Adata

Ver.: always

Returns

  • bool true if success


emberAfCalendarCommonAddDayProfInfo#

bool emberAfCalendarCommonAddDayProfInfo (uint32_t issuerCalendarId, uint8_t dayId, uint8_t * dayScheduleEntries, uint16_t dayScheduleEntriesLength)

Add day profile info.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AissuerCalendarId

Ver.: always

uint8_tN/AdayId

Ver.: always

uint8_t *N/AdayScheduleEntries

Ver.: always

uint16_tN/AdayScheduleEntriesLength

Ver.: always

Returns

  • bool true if success


emberAfCalendarServerSetWeekProfInfo#

bool emberAfCalendarServerSetWeekProfInfo (uint8_t index, uint8_t weekId, uint8_t dayIdRefMon, uint8_t dayIdRefTue, uint8_t dayIdRefWed, uint8_t dayIdRefThu, uint8_t dayIdRefFri, uint8_t dayIdRefSat, uint8_t dayIdRefSun)

Set calender server week profile info.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

Ver.: always

uint8_tN/AweekId

Ver.: always

uint8_tN/AdayIdRefMon

Ver.: always

uint8_tN/AdayIdRefTue

Ver.: always

uint8_tN/AdayIdRefWed

Ver.: always

uint8_tN/AdayIdRefThu

Ver.: always

uint8_tN/AdayIdRefFri

Ver.: always

uint8_tN/AdayIdRefSat

Ver.: always

uint8_tN/AdayIdRefSun

Ver.: always

Returns

  • bool true if success


emberAfCalendarServerAddWeekProfInfo#

bool emberAfCalendarServerAddWeekProfInfo (uint32_t issuerCalendarId, uint8_t weekId, uint8_t dayIdRefMon, uint8_t dayIdRefTue, uint8_t dayIdRefWed, uint8_t dayIdRefThu, uint8_t dayIdRefFri, uint8_t dayIdRefSat, uint8_t dayIdRefSun)

Add calender server week profile.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AissuerCalendarId

Ver.: always

uint8_tN/AweekId

Ver.: always

uint8_tN/AdayIdRefMon

Ver.: always

uint8_tN/AdayIdRefTue

Ver.: always

uint8_tN/AdayIdRefWed

Ver.: always

uint8_tN/AdayIdRefThu

Ver.: always

uint8_tN/AdayIdRefFri

Ver.: always

uint8_tN/AdayIdRefSat

Ver.: always

uint8_tN/AdayIdRefSun

Ver.: always

Returns

  • bool true if success


emberAfCalendarCommonAddSpecialDaysInfo#

bool emberAfCalendarCommonAddSpecialDaysInfo (uint32_t issuerCalendarId, uint8_t totalNumberOfSpecialDays, uint8_t * specialDaysEntries, uint16_t specialDaysEntriesLength, uint8_t * unknownSpecialDaysMask)

Updating special days information of the specified calendar. Assumes that the value of totalNumberOfSpecialDays will match up with the information passed in between specialDaysEntries and specialDaysEntriesLength.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AissuerCalendarId

Ver.: always

uint8_tN/AtotalNumberOfSpecialDays

Ver.: always

uint8_t *N/AspecialDaysEntries

Ver.: always

uint16_tN/AspecialDaysEntriesLength

Ver.: always

uint8_t *N/AunknownSpecialDaysMask

Ver.: always

Returns

  • bool true if success


Enumeration Documentation#

EmberAfPluginCalendarCommonFlags#

EmberAfPluginCalendarCommonFlags
Enumerator
EMBER_AF_PLUGIN_CALENDAR_COMMON_FLAGS_SENT

Variable Documentation#

calendars#

EmberAfCalendarStruct calendars[]