/*************************************************************** Function: void TCPIP_ZCLL_Initialize(void) Summary: Initialization routine for Zeroconf Link-Local state-machine. Description: This is initialization function for Zeroconf Link-Local and invoked from initialization portion of Main-function. This function registers with ARP-module to get notifications about the incoming packets. Checks whether the WiFi MAC is connected to an Access-Point or not. Parameters: None Returns: None ***************************************************************/ bool TCPIP_ZCLL_Initialize(const TCPIP_STACK_MODULE_CTRL* const stackCtrl, const ZCLL_MODULE_CONFIG* zeroData) { if(stackCtrl->stackAction != TCPIP_STACK_ACTION_IF_UP) { // stack init/restart if(zcllInitCount == 0) { // 1st time we run phZCLL = (ZCLL_NET_HANDLE*)TCPIP_HEAP_Calloc(stackCtrl->memH, stackCtrl->nIfs, sizeof(ZCLL_NET_HANDLE)); if(phZCLL == (ZCLL_NET_HANDLE*)0) { SYS_ERROR(SYS_ERROR_ERROR, "TCPIP_ZCLL_Initialize: Failed to allocate memory\r\n"); return false; } zcllSignalHandle =_TCPIPStackSignalHandlerRegister(TCPIP_THIS_MODULE_ID, TCPIP_ZCLL_Task, ZCLL_TASK_TICK_RATE); if(zcllSignalHandle == 0) { // cannot create the ZCLL timer _ZCLLCleanup(stackCtrl); return false; } } zcllInitCount++; } if(stackCtrl->pNetIf->Flags.bIsZcllEnabled != 0) { _ZCLLEnable(stackCtrl->pNetIf); } return true; }
bool TCPIP_ICMP_Initialize(const TCPIP_STACK_MODULE_CTRL* const stackCtrl, const TCPIP_ICMP_MODULE_CONFIG* const pIcmpInit) { if(stackCtrl->stackAction == TCPIP_STACK_ACTION_IF_UP) { // interface restart return true; } // stack start up if(icmpInitCount == 0) { // first time we're run bool iniRes; icmpMemH = stackCtrl->memH; while(true) { iniRes = (signalHandle =_TCPIPStackSignalHandlerRegister(TCPIP_THIS_MODULE_ID, TCPIP_ICMP_Task, 0)) != 0; if(iniRes == false) { break; } #if defined(TCPIP_STACK_USE_ICMP_CLIENT) && (TCPIP_ICMP_CLIENT_USER_NOTIFICATION != 0) iniRes = TCPIP_Notification_Initialize(&icmpRegisteredUsers); #endif // defined(TCPIP_STACK_USE_ICMP_CLIENT) && (TCPIP_ICMP_CLIENT_USER_NOTIFICATION != 0) break; } if(iniRes == false) { TCPIP_ICMP_Cleanup(); return false; } } // interface init // postpone packet allocation until the TCPIP_ICMP_EchoRequestSend is called // icmpInitCount++; return true; }
bool TCPIP_SMTP_ClientInitialize(const TCPIP_STACK_MODULE_CTRL* const stackCtrl, const TCPIP_SMTP_CLIENT_MODULE_CONFIG* pSmtpConfig) { if(stackCtrl->stackAction == TCPIP_STACK_ACTION_IF_UP) { // interface restart return true; } // stack init if(smtpInitCount == 0) { // first time we run // create the SMTP timer smtpTimerHandle =_TCPIPStackSignalHandlerRegister(TCPIP_THIS_MODULE_ID, TCPIP_SMTP_ClientTask, TCPIP_SMTP_TASK_TICK_RATE); if(smtpTimerHandle == 0) { // cannot create the SMTP timer return false; } } // Reset per interface state machine and flags to default values smtpInitCount++; return true; }