How the OR logic works


#1

hi,

can anyone explain how the OR logic works in the function

if the OR operation happens means the output is

0x0400|0x0200|0x0100|0x0011 = 0x711
so which type is called while run? READ or TEST or PARA

/* Subscribe to the 'AT+CUSTOMER' command. */
    s16 s16Return = adl_atCmdSubscribe( "AT+CUSTOMER",
                                        ( adl_atCmdHandler_t )ATCmdCustomer_Handler,
                                        ADL_CMD_TYPE_READ | ADL_CMD_TYPE_TEST |
                                        ADL_CMD_TYPE_PARA | 0x11 );

thanks


#2

This OR operation determines which type of AT command is subscribed to. So for example, if you have:

adl_atCmdSubscribe( "AT+CUSTOMER", ATCmdCustomer_Handler, ADL_CMD_TYPE_READ );

the callback function will only be called if you send the read command (AT+CUSTOMER?), and the Params->Type variable will be set to ADL_CMD_TYPE_READ. If you send anything else, you will receive an error.

Another example, if you have

adl_atCmdSubscribe( "AT+CUSTOMER", ATCmdCustomer_Handler, ADL_CMD_TYPE_READ | ADL_CMD_TYPE_PARA | 0x11 );

the callback function will be called on a read command (AT+CUSTOMER?) and a parameter command with at least one parameter and at most one parameter (AT+CUSTOMER=1). Any other type will return error (for example, AT+CUSTOMER=? or AT+CUSTOMER=1,2).

So in your example, the callback function will be called on a read command, a test command and a parameter command. The command type provided in the callback function (Params->Type), for example

void ATCmdCustomer_Handler (adl_atCmdPreParser_t * Params)

will depend on what command you send.


#3

Thanks tomridl,

also could you kindly look in to the following query also

[url]https://forum.sierrawireless.com/t/customeratcmdsend-give-error-response/6323/1]

thanks


#4

thank you for sharing


#5

Thank You So Much For providing the important information.


#6

Hi all. I’m just really puzzled on how logic gates work. I mean seriously, they are just composed of little bits of plastic put together in a circuit. How can plastic evaluate weather or not something is true or false?


#7

A perfectly competitive firm can trade as high a quantity as it wishes, as long as it allows the prevailing market cost. Total revenue is going to grow as the firm markets more, depending on the value of the product and the product of units sold.