Symbols
loading...
Files
loading...

aligenie_demo sample sample

aligenie_demo sample is a sample project defining the following symbols:

Most used functions

Name
Location
Summary
Start some blinking/breathing effects
Stop the effect in progress and keep the current lighting output
Stop all channel output
Stop all channel output
Initialize sm2235egh/sm2335egh output
Register the sm2135eh channel
Deinitialize sm2235egh/sm2335egh and release resources
Stop all channel output
Enable/Disable the lightbulb fade function
Stop the effect in progress and restore the previous lighting output
The handler for the underlying events. If necessary this handler dispatch the user events to applications.
Convert RGB model to HSV model
Initialize pwm output
Register the pwm channel
Set any channel output
Stop all channel output
Set output with hardware fade
Deinitialize pwm and release resources
Enable/Disable sleep status
Initialize sm2135e output
Register the sm2135e channel
Set any channel output
Deinitialize sm2135e and release resources
Initialize sm2135e output
Register the sm2135eh channel
Deinitialize sm2135eh and release resources
Initialize sm2135e output
Set any channel output
Register the bp5758d channel
Deinitialize bp5758d and release resources
Initialize bp1658cj output
Register the bp1658cj channel
Deinitialize bp1658cj and release resources
Initialize ws2812 output
Deinitialize ws2812 and release resources
Initialize kp18058 output
Set any channel output
Register the kp18058 channel
Deinitialize kp18058 and release resources
Deinitialize the lightbulb and release resources
Convert HSV model to RGB model
Convert xyY model to RGB model
Store lightbulb state to nvs.
Initialize the lightbulb
Get a semaphore's count. This routine returns the current count of @a sem.
Set color temperature (CCT)
Set only rgb channel output
Set only cct/brightness or cold/warm channel output
Set only rgb channel output
Set only wy channel output
Set only rgb channel output
Set only wy channel output
Set only rgb channel output
Set only cw channel output
Set only rgb channel output
Set only cw channel output
Set only rgb channel output
Set only rgb channel output
Set only cw channel output
Enable/Disable the lightbulb storage function
Re-update the lightbulb status variable
Get lightbulb fade function enabled status
Convert RGB model to xyY model
Convert CCT kelvin to percentage
Set xyY @attention The xyY color model cannot fully correspond to the HSV color model, so the color may be biased. The grayscale will be recalculated in lightbulb, so we cannot directly operate the underlying driver through the xyY interface.
Erase lightbulb state stored in nvs.
Used to test lightbulb hardware functionality
Give a semaphore. This routine gives @a sem, unless the semaphore is already at its maximum permitted count.
Take a semaphore. This routine takes @a sem.
Initialize a timer. This routine initializes a timer, prior to its first use.
fade processing logic fade_data[channel].num -> Fade cycle, This value is related to CHANGE_RATE_MS and fade_ms time fade_data[channel].step -> Fade step, < 0 indicates decrement, otherwise increment. The actual meaning is delta. fade_data[channel].cycle -> This value is used for the actions. fade_data[channel].cur -> Current value fade_data[channel].final -> Final value fade_data[channel].min -> Minimum value Final, min, cur are used to define a set of ranges, which will allow grayscale changes in arbitrary ranges, not from 0% to 100%.
check if the list is empty
Append a node to the given list This and other sys_slist_*() functions are not thread safe.
Convert Kelvin to CCT percentage input output 2200k 0 4600k 50 7200k 100
Find and remove a node from a list This and other sys_slist_*() functions are not thread safe.
get a reference to the head item in the list
get a reference to the next item in the list
@def genie_model_analyze analyze the received message and notify genie SDK
Convert CCT percentage to Kelvin input output 0 2200k 50 4600k 100 7200k
Convert CCT and brightness to cold and warm @attention White power was recalculated at the same time. input output(white_max_power = 100) output(white_max_power = 200) 0,100 0,255 0,255 50,100 127,127 255,255 100,100 255,0 255,0 0,0 0,0 0,0 0,50 0,127 0,127 0,100 0,255 0,255 50,0 0,0 0,0 50,50 63,63 127,127 50,100 127,127 255,255 100,0 0,0 0,0 100,50 127,0 127,0 100,100 255,0 255,0
add node to tail of list This and other sys_dlist_*() functions are not thread safe.
remove a specific node from a list The list is implicit from the node. The node must be part of a list. This and other sys_dlist_*() functions are not thread safe.
Peek the first node from the list
Peek the next node from current node
@def genie_model_msg_send send the vendor model message
start poweron indicate timer.
Initializing Genie Mesh components.
Store reboot count in flash.
@def genie_model_msg_check_tid check received vendor message's tid
Initialize the function that resets whole system by multiple reboot in GENIE_RESET_BY_REPEAT_TIMEOUT.
Initialize a semaphore. This routine initializes a semaphore object, prior to its first use.
Start the timer to handle the program reset operation. Avoid reset indication messages not reaching Genie Speaker.
Clean the recored count for reboot.
check wether a timer is started or not.
Start timer specified by index.
Start periodic timer specified by index.
Dispatch message according opcode.
check whether there is this tid in record, and record it if not.
Genie vendor model indicate self status.
GENIE_RESET_BY_REPEAT_TIMEOUT
@def genie_model_retry_timer_cb timeout handler for the g_vnd_msg_timer
@def genie_model_msg_node_free free the vendor model message node struct's memory
To resolve some compilation warning issues
Recalculate white power @attention Please refer to `cct_and_brightness_convert_to_cold_and_warm`
Recalculate value input output 100 100 80 82 50 55 11 19 1 10 0 0
Recalculate brightness input output 100 100 80 82 50 55 11 19 1 10 0 0
Recalculate color power @attention 300% = 100% + 100% + 100% : Full power output on each channel. If single channel output is 3w then total output is 9w.
Fetch and remove the first node of the given list List must be known to be non-empty. This and other sys_slist_*() functions are not thread safe.
Fetch and remove the first node of the given list This and other sys_slist_*() functions are not thread safe.
Remove a node This and other sys_slist_*() functions are not thread safe.
get a reference to the next item in the list, node is not NULL Faster than genie_dlist_peek_next() if node is known not to be NULL.
add node to head of list This and other sys_dlist_*() functions are not thread safe.
insert node before a node Insert a node before a specified node in a list. This and other sys_dlist_*() functions are not thread safe.
Test if the given list is empty
Peek the next node from current node, node is not NULL Faster then genie_slist_peek_next() if node is known not to be NULL.
Prepend a node to the given list This and other sys_slist_*() functions are not thread safe.
Append a list to the given list Append a singly-linked, NULL-terminated list consisting of nodes containing the pointer to the next node as the first element of a node, to @a list. This and other sys_slist_*() functions are not thread safe.
Delete a semaphore. This routine delete @a sem,
Get a semaphore's count. This routine returns the current count of @a sem.
Initializing element state.
Handle hardware reset, and indicate hardware reset.
Genie Mesh Component Init, 1. Handle Mesh Init according esp-ble-mesh init status 2. Start power indeicate if ble-mesh already provisioned 3. Start PB-ADV Timer if ble-mesh not provisioned 4. Hardware reset ble-mesh provision information if reset flag be configed.
After the Bluetooth Mesh device is powered on, if it is in the unprovisioned state, it needs to broadcast the Unprovisioned Device Beacon, and the broadcast duration is 10 minutes by default
If the network is still not configured after the timeout, the device enters the silent broadcast state and closes the PB_GATT broadcast.
Reset timer callback timeout, Send event to genie event to handle reset action.
Read reboot count from flash.
@def genie_model_msg_list_append duplicate genie_model_msg_t and append it to vendor model message list to be monitored
@def genie_model_msg_node_generate duplicate genie_model_msg_t and save to genie_model_msg_node_t
@def genie_model_set_ack handle GENIE_OP_ATTR_SET_ACK message
@def genie_model_set_unack handle GENIE_OP_ATTR_SET_UNACK message
@def genie_model_confirm handle GENIE_OP_ATTR_CONFIME message
@def genie_model_confirm_tg handle GENIE_OP_ATTR_CONFIME_TG message
@def genie_model_transparent handle GENIE_OP_ATTR_TRANS_MSG message
@def genie_model_transparent_ack handle GENIE_OP_ATTR_TRANS_ACK message
@def genie_model_get_status handle GENIE_OP_ATTR_GET_STATUS message
@def genie_model_init vendor model server related global parameter initialization
Get Genie Vendor Model Appkey ID
Get Genie Vendor Model Netkey ID
@def genie_model_msg_gen_tid generate tid used in vendor model message
merge two slists, appending the second one to the first When the operation is completed, the appending list is empty. This and other sys_slist_*() functions are not thread safe.
Insert a node to the given list This and other sys_slist_*() functions are not thread safe.
check if a node is the list's head
check if a node is the list's tail
check if more than one node present This and other sys_dlist_*() functions are not thread safe.
get a reference to the head item in the list The list must be known to be non-empty.
get a reference to the tail item in the list
insert node after a node Insert a node after a specified node in a list. This and other sys_dlist_*() functions are not thread safe.
insert node at position Insert a node in a location depending on a external condition. The cond() function checks if the node is to be inserted _before_ the current node against which it is checked. This and other sys_dlist_*() functions are not thread safe.
get the first node in a list This and other sys_dlist_*() functions are not thread safe.
Peek the last node from the list
get the remain bytes of message
stop the delay_timer and trans_timer for element.
clear trans parameter.
calculater current state.

Other commonly used symbols

Name
Location
Summary
KP18058 register start address - Byte0
The working status of the lightbulb. @attention Both the variable `value` and the variable `brightness` are used to mark light brightness. They respectively indicate the brightness of color light and white light.
BP5758D register current address - Byte2-6 BP5758D register grayscale address - Byte7-16
Resource Access Control
Effect function configuration options
Used to save the current state and target state of the device
p_elem: pointer to the element which the messsage want to be sent to retry: retry counts before desired confirm message received * fill negative value if retransmission is not necessary * fill positive value if retransmission is needed * * will be round in this scope - [GENIE_MODEL_MSG_DFT_RETRY_TIMES, GENIE_MODEL_MSG_MAX_RETRY_TIMES] retry_period: wait for retry_period before retransmit the message, in unit of ms opid: hightest byte in Opcode defined in the vendor model spec designed by Alibaba IoT Group * e.g. for Vendor Message Attr Get message, Opcode is 0xD001A8, corresponding opid is 0xD0 * refer to the marco named VENDOR_OP_ATTR_xxxx tid: * if the message is with type of GENIE_OP_ATTR_CONFIME or GENIE_OP_ATTR_CONFIME_TG, * tid should be filled with the replied message's tid len: payload length data: pointer to the genie vendor message's payload
Output configuration
Output configuration
Output configuration
Output configuration
Output configuration
Output configuration
Output configuration
These configurations are used for color calibration.
sm2135e register grayscale address - Byte3-7
SM2135EH register grayscale address - Byte3-7
SM2x35EGH register current address - Byte1 SM2x35EGH register grayscale address - Byte2-7
BP1658CJ register current address - Byte1 BP1658CJ register grayscale address - Byte 2-11
Lightbulb Configuration Options @attention If the `gamma_conf` `external_limit` variable is not set, will use the default value.
0% -> .. -> 100% 2200K -> .. -> 7000K warm -> .. -> cold
Output limit or gain without changing color
Used to map percentages to kelvin
Some Lightbulb Capability Configuration Options
Use an external custom gamma table.
Function pointers to monitor the workings of the underlying hardware
Map color channels to IDs | Rule 1 | Rule 2 | Rule 3 | | | | RED | RED | RED | GREEN | GREEN | GREEN | BLUE | BLUE | BLUE | COLD | CCT | WHITE | WARM | BRIGHTNESS | YELLOW
Lightbulb fade time calculate
sm2135e register current address - Byte1 sm2135e register mode address - Byte2
SM2135EH register current address - Byte1 SM2135EH register standby mode address - Byte2
Alibaba Incorporated
Function pointers to store lightbulb status
some default configuration
BP5758D register out control address - Byte1
KP18058 register baseline voltage compensation address - Byte1
KP18058 register OUT1 - OUT3 Max current and Chopping frequency - Byte2
KP18058 register OUT4 - OUT5 Max current and Chopping frequency - Byte3
Genie All Product Group Address
Genie Light Product Group Address
g_vnd_msg_list was used to save the unconfirmed vendor messages g_vnd_msg_timer was used to control when the vendor messages saved in g_vnd_msg_list will be resent
Used to save the device's power-down state and the previous state
Genie Vendor Model Server ID
genie timer event handle callback function.
Provide the primitive to iterate on a list Note: the loop is unsafe and thus __dn should not be removed User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_DLIST_FOR_EACH_NODE(l, n) { } This and other SYS_DLIST_*() macros are not thread safe.
Provide the primitive to safely iterate on a list under a container Note: __cn can be detached, it will not break the loop. User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_SLIST_FOR_EACH_NODE_SAFE(l, c, cn, n) { }
ESP BLE Mesh Health Server Model Context
@def g_vendor_model_alibaba_op vendor model operations struct
Provide the primitive to iterate on a list Note: the loop is unsafe and thus __sn should not be removed User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_SLIST_FOR_EACH_NODE(l, n) { } This and other SYS_SLIST_*() macros are not thread safe.
Genie Receive Address
Mesh Provision Timeout, unit: ms
Mesh Provision Advertise Timeout, unit: ms
@file Single-linked list implementation Single-linked list implementation using inline macros/functions. This API is not thread safe, and thus if a list is used across threads, calls to functions must be protected with synchronization primitives.
Provide the primitive to iterate on a list, from a node in the list Note: the loop is unsafe and thus __sn should not be removed User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_SLIST_ITERATE_FROM_NODE(l, n) { } Like GENIE_SLIST_FOR_EACH_NODE(), but __dn already contains a node in the list where to start searching for the next entry from. If NULL, it starts from the head. This and other SYS_SLIST_*() macros are not thread safe.
Provide the primitive to safely iterate on a list Note: __sn can be removed, it will not break the loop. User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_SLIST_FOR_EACH_NODE_SAFE(l, n, s) { } This and other SYS_SLIST_*() macros are not thread safe.
Provide the primitive to iterate on a list under a container Note: the loop is unsafe and thus __cn should not be detached User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_SLIST_FOR_EACH_CONTAINER(l, c, n) { }
@file Doubly-linked list implementation Doubly-linked list implementation using inline macros/functions. This API is not thread safe, and thus if a list is used across threads, calls to functions must be protected with synchronization primitives. The lists are expected to be initialized such that both the head and tail pointers point to the list itself. Initializing the lists in such a fashion simplifies the adding and removing of nodes to/from the list.
Provide the primitive to iterate on a list, from a node in the list Note: the loop is unsafe and thus __dn should not be removed User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_DLIST_ITERATE_FROM_NODE(l, n) { } Like GENIE_DLIST_FOR_EACH_NODE(), but __dn already contains a node in the list where to start searching for the next entry from. If NULL, it starts from the head. This and other SYS_DLIST_*() macros are not thread safe.
Provide the primitive to safely iterate on a list Note: __dn can be removed, it will not break the loop. User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_DLIST_FOR_EACH_NODE_SAFE(l, n, s) { } This and other SYS_DLIST_*() macros are not thread safe.
Provide the primitive to iterate on a list under a container Note: the loop is unsafe and thus __cn should not be detached User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_DLIST_FOR_EACH_CONTAINER(l, c, n) { }
Provide the primitive to safely iterate on a list under a container Note: __cn can be detached, it will not break the loop. User _MUST_ add the loop statement curly braces enclosing its own code: GENIE_DLIST_FOR_EACH_CONTAINER_SAFE(l, c, cn, n) { }
Genie Vendor Model Client ID
Genie OTA Group Address
Genie Switch Product Group Address

Dependencies