OMNET++ ZIGBEE

OMNeT++ ZIGBEE is used In order to satisfy the demand of low power dissipation and low speed among wireless communication devices, a new type of wireless net technology-ZIGBEE.

 

Types of feature sets in ZIGBEE:

  • ZIGBEE PRO
  • ZIGBEE

These are all the two different feature sets present in ZIGBEE

OMNeT++ ZIGBEE PROJECTS

Features of ZIGBEE:

  • Security key generation mechanism.
  • Supports alliance standards.
  • Regional operation in the 915Mhz.
  • Various transmission options including broadcast.
  • Global operation in the 2.4Ghz frequency band according to IEEE 802.15.4.
  • Discovery mechanism with full application confirmation etc.
Architecture of ZIGBEE:

ZIGBEE device types:

There are three different standard types are as follows,

  • ZIGBEE physical device type.
  • Combination of application.
  • ZIGBEE logical.

Sample code for ZIGBEE:

void TimerService::setTimer(int timerIndex, simtime_t time)
{
	if (timerIndex < 0) opp_error("setTimer(): timerIndex=%i negative index is not allowed",timerIndex); if (timerIndex >= TIMER_MAX_SIZE)
		opp_error("setTimer(): timerIndex=%i is too large",timerIndex);
	cancelTimer(timerIndex);
	if (timerIndex >= timerMessages.size()) {
		int newSize = timerMessages.size() + TIMER_MIN_SIZE;
		if (newSize > TIMER_MAX_SIZE)
			newSize = TIMER_MAX_SIZE;
		else if (timerIndex >= newSize)
			newSize = timerIndex + 1;
		timerMessages.resize(newSize,NULL);
	}
	timerMessages[timerIndex] = new TimerServiceMessage("Timer message", TIMER_SERVICE);
	timerMessages[timerIndex]->setTimerIndex(timerIndex);
	scheduleAt(simTime() + timerDrift * time, timerMessages[timerIndex]);
}

void TimerService::handleTimerMessage(cMessage * msg)
{
	int msgKind = (int)msg->getKind();
	if (msgKind == TIMER_SERVICE) {
		TimerServiceMessage *timerMsg = check_and_cast<TimerServiceMessage*>(msg);
		int timerIndex = timerMsg->getTimerIndex();
		if (timerIndex < 0 || timerIndex >= timerMessages.size()) 
			return;
		if (timerMessages[timerIndex] != NULL) {
			timerMessages[timerIndex] = NULL;
			timerFiredCallback(timerIndex);
		} 
	}
}