beautypg.com

ProSoft Technology MVI69-ADMNET User Manual

Page 71

background image

MVI-ADMNET ♦ 'C' Programmable

Application Development Function Library - ADMNET API

'C' Programmable Application Development Module with Ethernet

Developer's Guide

ProSoft Technology, Inc.

Page 71 of 122

February 20, 2013

ADM_send_sk

Syntax

int ADM_send_sk(char *skName, char *holdSendPtr, int *sendLen);

Parameters

skName

Name of the socket that has been initialized and used
to send data.

holdSendPtr

Pointer to a string of data that will be sent to the
ServerIPAddress

sendLen

Number of data specified to send.

Description
ADM_ send _sk sends with a socket previously open using ADM_open_sk.

Return Value

SK_SUCCESS

API has successfully open socket.

SK_PROCESS_SOCKET

Open process is still in

SK_NOT_FOUND

API could not find an initialized socket with the name
passed to the function.

Example

char sockName1[ ] = "SendSocket";
char holdingReg[100];
int buffSize1 = 4096;
int port_1 = 6565;
int numSocket1 = 1;
int result;

sock_init(); //initialize the socket interface
ADM_init_socket(numSocket1, port_1, buffSize1, sockName1);

sprintf(holdingReg,"abcdefghijklmnopqrstuvwxyz-");
sendLen = 27;

while ((result = ADM_send_sk(sockName1, holdingReg, &sendLen)) ==
SK_PROCESS_SOCKET);

if(result == SK_SUCCESS)
{
printf("Data: %s Sent \n", holdingReg);
} else {
printf("Error sending data\n");
}

See Also
ADM_receive_sk (page 73)