JevRegistEvent
- Organization of this page
Description
This function issues a JP1 event to the JP1/Base event server. Normal termination of this function assures that the local event server has successfully accepted the JP1 event.
Definition header
JevApi.h
Format
int JevRegistEvent(long* status, const char* server, long baseID, const char* message, const char** extattrs, int extcount);
Arguments
status
In status, specify the address of the area for storing the status code returned if this function terminates abnormally. The following explains the status codes that may be returned.
Status code |
Meaning |
---|---|
JEV_NO_LIBRARY |
No library is found.# Alternatively, the shared library cannot be found because too many files are opened. |
JEV_S_CONNECT_ERROR |
Failed to connect the event service. |
JEV_S_INVALID_ID |
The event ID is invalid. |
JEV_S_INVALID_SERVER |
The event server name is invalid. |
JEV_S_INVALID_EXT_NAME |
An extended attribute name is invalid. |
JEV_S_OVER_EXT_COUNT |
The number of extended attributes exceeds the maximum. |
JEV_S_OVER_EXT_SIZE |
The total size of extended attributes exceeds the maximum. |
JEV_S_OVER_MESSAGE |
The message length exceeds the maximum. |
JEV_S_PARAM_ERROR |
An invalid parameter is specified. |
JEV_S_NOT_SUPPORT |
The version is not supported. |
JEV_S_MAXOPEN |
The number of opened files reached the maximum. |
JEV_S_NOMEMORY |
Memory is insufficient. |
JEV_S_IO_ERR |
An I/O error occurred. |
JEV_S_SYSTEM_ERROR |
A system error occurred. |
#: Check if necessary files have been deleted or if incorrect compile options are specified. If necessary files have been deleted, reinstall JP1/Base. If compile options are incorrect, reconfigure the option settings.
server
In server, specify a pointer to a character string that ends with \0 and indicates the name of the destination event server running on the local host. If you specify a NULL pointer, this function attempts to connect the event server that has the same name as the local host. Specify an event server name of 256 bytes or less, including the \0.
baseID
In baseID, specify a numeric value that indicates the basic part of the event ID you want to register. You can specify one of the following values:
-
0x00000000
-
0x00000001 to 0x00001FFF
-
0x7FFF8000 to 0x7FFFFFFF
message
In server, specify a pointer to a character string that ends with \0 and indicates the message you want to register. Specify a message of 1,024 bytes or less, including the \0.
extattrs
In extattrs, specify a string array containing extended-attribute strings. Each extended-attribute string in the array has the extended-attribute-name=extended-attribute-value format and ends with \0.
extended-attribute-name is a character string that indicates the meaning of the attribute. You can use up to 32 alphanumeric characters including underscores (_) to specify extended-attribute-name. For alphabetic characters, you can use upper-case characters only. The specified character string must begin with an alphabetic character.
extended-attribute-value is a character string containing the value of the attribute. The character string can have 0 to 10,000 bytes.
You can specify up to 100 extended attributes. The maximum number of bytes used in all attribute values is 10,000 bytes.
If you specify a NULL pointer as an argument, extended attributes are not registered.
For details on extended attributes, see Appendix A. Criteria for Setting JP1 Event Attributes.
extcount
In extcount, specify the number of extended attributes you want to register. This value is ignored if a NULL pointer is specified in extattrs.
Return values
Situation |
Explanation |
---|---|
Normal termination |
The function returns 0. |
Abnormal termination |
The function returns -1. |
Note
If you specify character strings containing the same extended attribute name, the last character string takes effect.