Each layer offers its services in the form of primitives. Four
classes of primitives are defined as shown in Figure 1. Request is
issued by the layer that wants to get the services or the information
from another layer, and Confirm is the acknowledgment of the request.
Indication is the notification of the information to the layer that
requested the service, and Response is the acknowledgment of the
indication.
------------------------- -----------------------------
Request Response
|| / / ||
Layer N || || || ||
------------||------||--- -------||------||------------
|| || || ||
/ || || /
Layer N-m Confirm Indication
------------------------- -----------------------------
Figure 1: Interaction Model between Layers
/*send the packet*/
send_result = sendto(s, buffer, ETH_FRAME_LEN, 0,
(struct sockaddr*)&socket_address, sizeof(socket_address));
if (send_result == -1) { errorhandling... }
Example 1.6. Receive a RAW ethernet frame
void* buffer = (void*)malloc(ETH_FRAME_LEN); /*Buffer for ethernet frame*/
int length = 0; /*length of the received frame*/
...
length = recvfrom(s, buffer, ETH_FRAME_LEN, 0, NULL, NULL);
if (length == -1) { errorhandling .... }
void httpRequest()
{
byte theByte;
xPortSerial.print("GET ");
xPortSerial.print(PHP_PAGE_LOCATION);
// value0 = 123 and value1 = 456
// You should change these to be your sensor values or whatever you want to send
// (see php code if you want to add more values or change the names value0/value1
xPortSerial.print("?value0=123&value1=456");
xPortSerial.print(" HTTP/1.1n");
xPortSerial.print(WEB_HOST);
while(!xPortSerial.available()) {} // Just loop until available
theByte = xPortSerial.read();
if (theByte != 0)
Serial.println("Passed.");
else
Serial.println("Failed.");
}
The new CodeWarrior suites are available at the following costs
(USD) on all Freescale architectures currently supported by
CodeWarrior Development Studio:
-- Professional suite: Includes all full featured development
tools for the highest level of product functionality - $4995
Perpetual License / $1995 Annual Subscription
-- Standard suite: Provides access to all selectively featured
development tools - $2495 Perpetual License / $995 Annual
Subscription
-- Basic suite: Includes all necessary CodeWarrior tools for
Compiler Upgrades, Linux Applications Editions and Flash
Programmers - $995 Perpetual License / $395 Annual
Subscription
-- Special Edition: Feature limited tools - freely available
For detailed information about each CodeWarrior suite, visit
www.freescale.com/codewarrior.