Logitech GArx Control
Logitech GArx Control
The Logitech|G Arx Control SDK, including all accompanying documentation, is protected by
intellectual property laws. All use of the Logitech|G Arx Control SDK is subject to the
License Agreement found at the end of this document. If you do not agree to the terms and
conditions of the License Agreement, you must immediately return any documentation, the
accompanying software and all other material provided to you by Logitech. All rights not
expressly granted by Logitech are reserved.
Logitech|G Arx Control SDK
Contents
Overview ............................................................................................................................................3
SDK Package ...................................................................................................................................3
Requirements ..................................................................................................................................3
Interfacing with the SDK ..................................................................................................................3
Multiple clients using the SDK at the same time .................................................................................3
Multiple mobile devices connected to Logitech Gaming Software ........................................................3
Multithread access to the SDK ..........................................................................................................3
Do’s and Don’ts ..................................................................................................................................4
Sample usage of the SDK ....................................................................................................................4
Using header and lib ........................................................................................................................4
How to use the context parameter in the initialization ........................................................................4
Reference ...........................................................................................................................................6
LogiArxInit ......................................................................................................................................6
LogiArxAddFileAs .............................................................................................................................7
LogiArxAddContentAs .......................................................................................................................8
LogiArxAddUTF8StringAs ..................................................................................................................9
LogiArxAddImageFromBitmap ..........................................................................................................9
LogiArxSetIndex ............................................................................................................................ 10
LogiArxSetTagPropertyById ............................................................................................................ 10
LogiArxSetTagsPropertyByClass ...................................................................................................... 11
LogiArxSetTagContentById ............................................................................................................. 11
LogiArxSetTagsContentByClass ....................................................................................................... 12
LogiArxGetLastError ....................................................................................................................... 12
LogiArxShutdown ........................................................................................................................... 13
End-User License Agreement for Logitech|G Arx Control SDK.............................................................. 13
Page 2
Logitech|G Arx Control SDK
Overview
The Logitech|G Arx Control Software Development Kit enables applications such as games to interact with
the Arx Control app on mobile devices.
Arx Control allows games and third party developers to take advantage of an iOS/Android device as a
secondary screen to display useful data from the game.
SDK Package
The following files are included:
LogitechGArxControlLib.h: C/C++ header file containing function prototypes
LogitechGArxControlLib.lib: companion lib file to access DLL exported functions (32 and 64 bit)
Requirements
The Logitech|G Arx Control SDK can be used on the following platforms:
Windows Vista (32-bit and 64-bit)
Windows 7 (32-bit and 64-bit)
Windows 8 (32-bit and 64-bit)
Logitech Gaming Software (8.52 or higher) needs to be running in order to use this SDK.
The SDK is a Windows based API for C/C++ programmers. The applet layout is based on web
programming, so a basic knowledge of HTML/JavaScript/CSS is also needed.
Page 3
Logitech|G Arx Control SDK
DON’TS
Data is sent over Wi-Fi. Don’t send oversized images or files. Try to optimize the format of any
file that will be part of the applet.
Page 4
Logitech|G Arx Control SDK
//Using the main window handle to be notified on the main thread through PostMessage
on the main handle
arxContextStruct.arxContext = m_hwnd;
case LOGI_ARX_EVENT_FOCUS_ACTIVE:
{
if(callbackMessageStruct->eventValue ==
LOGI_ARX_ORIENTATION_PORTRAIT)
{
printf("applet focus active in portrait mode\n");
}
if(callbackMessageStruct->eventValue ==
LOGI_ARX_ORIENTATION_LANDSCAPE)
{
printf("applet focus active in landscape mode\n");
}
break;
}
case LOGI_ARX_EVENT_MOBILEDEVICE_ARRIVAL:
{
printf("mobile device arrival\n");
break;
}
case LOGI_ARX_EVENT_MOBILEDEVICE_REMOVAL:
{
printf("mobile device removal\n");
Page 5
Logitech|G Arx Control SDK
break;
}
case LOGI_ARX_EVENT_TAP_ON_TAG:
{
wprintf(L"click on tag with id %ls\n",
callbackMessageStruct->eventArg);
break;
}
default:
{
printf("unknown message %d:%d",
callbackMessageStruct->eventType,
callbackMessageStruct->eventValue);
}
break;
}
Reference
LogiArxInit
The LogiArxInit function makes sure there isn’t already another instance running and then makes
necessary initializations.
Parameters
identifier: A unique identifier for the game or application. Text length is capped to 128
characters, any string longer than that will be truncated (e.g. com. company. game)
friendlyName: the name that will be displayed on Arx Control for this applet. Text length is
capped to 128 characters, any string longer than that will be truncated
callbackContest : a logiArxCbContext struct containing the callback function reference and the
context where to call it. See sample above to see how to use this. The context field in this struct
can be NULL if there is no need to be notified in a different thread. The parameter can be NULL
in case there is no need to be notified at all.
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code.
The return value is only dependent on the communication with Logitech Gaming Software. A true return
value doesn’t mean that there is a device and therefore a Arx Control running at the moment.
If the function fails and the error code is 6, this means that Logitech Gaming Software is not running at
the moment, or the version running doesn’t meet the minimum requirements for Arx Control. If this is the
Page 6
Logitech|G Arx Control SDK
case do not send any file or update, everything will be lost. A suggested implementation is to check in a
later moment either with some user interaction (from the game GUI) or with a timer.
Remarks
The callback function is the only way to be notified of a status change of the applet and therefore the
only way to know that the applet is running.
This function will be called when an event occurs. Here are the possible values for the parameter
eventType:
LogiArxAddFileAs
The LogiArxAddFileAs function sends a file from a local path to Arx Control.
Page 7
Logitech|G Arx Control SDK
Parameters
filePath: A string that represents a local path. This can be both relative to the game executable
or absolute. Text length is capped to 256 characters, any string longer than that will be
truncated
fileName: A string that represents how the file will be referenced once loaded in Arx Control.
Text length is capped to 256 characters, any string longer than that will be truncated
mimeType – Optional - : A string that represents the mime type to associate the file with. This
will determine how the app will interpret this file in the webview. This parameter is optional, the
default value is an empty string. If the parameter is left empty the app will try to assign the right
mime type to the file depending on its extension.
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
The return value is only dependent on the communication with Logitech Gaming Software. A true return
value doesn’t mean that the file already made it all the way to the App.
LogiArxAddContentAs
The LogiArxAddContentAs function sends a block of memory to Arx Control.
Parameters
content: A pointer to the block of memory to be sent to the Arx Control
size: the size of the block of memory
filename : A string that represents how the file will be referenced once loaded in Arx Control.
Text length is capped to 256 characters, any string longer than that will be truncated
mimeType – Optional - : A string that represents the mime type to associate the file with. This
will determine how the app will interpret this file in the webview. This parameter is optional, the
default value is an empty string. If the parameter is left empty the app will try to assign the right
mime type to the file depending on its extension.
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
If the size specified is bigger than the memory allocated for the pointer content, the function may raise
an exception. If the size is smaller, only the first size byte will be sent.
Page 8
Logitech|G Arx Control SDK
LogiArxAddUTF8StringAs
The LogiArxAddUTF8StringAs function saves a string encoded in UTF8 to a file and sends it to Arx
Control.
Parameters
stringContent: the string to be saved to file and sent over to Arx Control
filename: the name of the file where the string will be saved and how it will be referenced once
loaded in Arx Control. Text length is capped to 256 characters, any string longer than that will be
truncated
mimeType – Optional - : A string that represents the mime type to associate the file with. This
will determine how the app will interpret this file in the webview. This parameter is optional, the
default value is an empty string. If the parameter is left empty the app will try to assign the right
mime type to the file depending on its extension.
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
LogiArxAddImageFromBitmap
The LogiArxAddImageFromBitmap function compresses the image in a png format and sends it to
Arx Control.
Parameters
bitmap: A BYTE array that identifies the image
width: the width in pixel of the image
height: the height in pixel of the image
filename: A string that represents how the image will be referenced once loaded in Arx Control.
The function will not automatically include the extension “.png”. Text length is capped to 256
characters, any string longer than that will be truncated
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
The illustration below shows the data arrangement required for the BYTE array bitmap.
Page 9
Logitech|G Arx Control SDK
Each of the bytes in the RGBA quad specify the intensity of the given value. The value ranges from 0 (the
darkest color value) to 255 (brightest color value).
The expected allocated memory for the bitmap parameter is width * height * 4. If the memory allocated
is less than what the function expects it may cause an exception.
The mime type associated with this file will always be “image/png”, since the file is automatically
compressed by Logitech Gaming Software in the PNG format.
LogiArxSetIndex
The LogiArxSetIndex function sets which page is the one to be displayed on Arx Control.
Parameters
fileName: A string that represents the file to display on Arx Control. This can be a file that has
been sent with any of the above function calls. Text length is capped to 256 characters, any
string longer than that will be truncated
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
The first time this function is called on a valid file the applet will be brought in the foreground on Arx
Control.
LogiArxSetTagPropertyById
The LogiArxSetTagPropertyById function updates a tag property in the applet html pages.
Parameters
tagId: The id of the tag to update the property on. Text length is capped to 128 characters, any
string longer than that will be truncated
Page 10
Logitech|G Arx Control SDK
prop: The property to update. Text length is capped to 128 characters, any string longer than
that will be truncated
newValue: The new value to assign to the property prop on the tag with id tagId. Text length is
capped to 128 characters, any string longer than that will be truncated
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
If the no tag with id tagId is found, the function will return true and no tag will be updated. If more than
one tag on any page have the same id, each one of them will be updated.
LogiArxSetTagsPropertyByClass
The LogiArxSetTagsPropertyByClass function updates a property on a class of tags in the applet html
pages.
Parameters
tagClass: The class of the tags to update the property on. Text length is capped to 128
characters, any string longer than that will be truncated
prop: The property to update. Text length is capped to 128 characters, any string longer than
that will be truncated
newValue: The new value to assign to the property prop on all the tags with class tagClass. Text
length is capped to 128 characters, any string longer than that will be truncated
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
If the no tag with class tagClass is found, the function will return true and no tag will be updated.
LogiArxSetTagContentById
The LogiArxSetTagContentById function updates the content of a tag in the applet html pages.
Parameters
tagId: The id of the tag to update the property on. Text length is capped to 128 characters, any
string longer than that will be truncated
newContent: The new html content that will be injected in the tag.
Page 11
Logitech|G Arx Control SDK
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
If the no tag with id tagId is found, the function will return true and no tag content will be updated.
LogiArxSetTagsContentByClass
The LogiArxSetTagsContentByClass function updates the content of a class of tags in the applet html
pages.
Parameters
tagClass: The class of the tags for which the content will be replaced. Text length is capped to
128 characters, any string longer than that will be truncated
newContent: The new html content that will be injected in the tags.
Return value
If the function succeeds, it returns true. Otherwise false. Call LogiArxGetLastError to get the error code
Remarks
If the no tag with class tagClass is found, the function will return true and no tag will be updated.
LogiArxGetLastError
The LogiArxGetLastError function retrieves and returns the last error occurred in the SDK function
calls. Call this function if an SDK function call fails to get more detailed information on the failure.
int LogiArxGetLastError();
Return value
The return value indicates the error code according to this table:
Page 12
Logitech|G Arx Control SDK
Remarks
When any of the function calls returns error code 6 – Connection with Logitech Gaming Software broken,
is a sign that Logitech Gaming Software will not receive any of the subsequent calls. The applet will be
removed from the active on Arx Control. The suggested procedure in this case is to call LogiArxShutdown
to prevent any memory leak.
LogiArxShutdown
The LogiArxShutdown function frees the memory used by the SDK for the applet and shuts it down on
Arx Control.
void LogiArxShutdown();
Remarks
If using a multithreaded environment, call this function only any other thread that was dealing with the
Arx Control SDK has finished its execution. Calling LogiArxShutdown while other function calls are
pending might cause unexpected behavior.
This End-User License Agreement for Logitech Gaming ARX CONTROL SDK ( “Agreement”) is a legal
agreement between you, either an individual or legal entity (“You” or “you”) and Logitech Inc. (“Logitech”) for use of
the Logitech Gaming ARX CONTROL software development kit, which includes computer software and related media
and documentation (hereinafter “Logitech Gaming ARX CONTROL SDK”). By using this Logitech Gaming ARX
CONTROL SDK, you are agreeing to be bound by the terms and conditions of this Agreement. If you do not agree to
the terms and conditions of this Agreement, promptly return the Logitech Gaming ARX CONTROL SDK and other
items that are part of this product in their original package, or if you have downloaded this software from a Logitech or
a Distributor web site, then you must stop using the software and destroy any copies of the software in your
possession or control.
1 Grant of License and Restrictions. This Agreement grants You the following rights provided that You
(a) Logitech grants You a limited, non-exclusive, nontransferable license to install and use an unlimited
number of copies of the Logitech Gaming ARX CONTROL SDK on computers. All other rights are
reserved to Logitech.
Page 13
Logitech|G Arx Control SDK
(b) You shall not reverse engineer, decompile or disassemble any portion of the Logitech Gaming ARX
CONTROL SDK, except and only to the extent that this limitation is expressly prohibited by
applicable law.
(c) At your option, you may provide reasonable feedback to Logitech, including but not limited to
usability, bug reports and test results, with respect to the Logitech Gaming ARX CONTROL SDK.
All bug reports, test results and other feedback provided to Logitech by You shall be the property of
(d) In the event Logitech, in its sole discretion, elects to provide copies of the Logitech Gaming ARX
CONTROL SDK to more than one individual employed by You (if You are not a single individual),
each such individual shall be entitled to exercise the rights granted in this Agreement and shall be
2 Updates. Logitech is not obligated to provide technical support or updates to You for the Logitech Gaming
ARX CONTROL SDK provided to You pursuant to this Agreement. However, Logitech may, in its sole
discretion, provide further pre-release versions, technical support, updates and/or supplements (“Updates”)
to You, in which case such Updates shall be deemed to be included in the “Logitech Gaming ARX
CONTROL SDK” and shall be governed by this Agreement, unless other terms of use are provided in writing
3 Intellectual Property Rights. The Logitech Gaming ARX CONTROL SDK is licensed, not sold, to You for
use only under the terms and conditions of this Agreement. Logitech and its suppliers retain title to the
Logitech Gaming ARX CONTROL SDK and all intellectual property rights therein. The Logitech Gaming
ARX CONTROL SDK is protected by intellectual property laws and international treaties, including U.S.
copyright law and international copyright treaties. All rights not expressly granted by Logitech are reserved.
ITS SUPPLIERS AND DISTRIBUTORS PROVIDE THE LOGITECH GAMING ARX CONTROL SDK AND
OTHER LOGITECH PRODUCTS AND SERVICES (IF ANY) AS IS AND WITHOUT WARRANTY OF ANY
KIND. LOGITECH AND ITS SUPPLIERS AND DISTRIBUTORS EXPRESSLY DISCLAIM ALL
Page 14
Logitech|G Arx Control SDK
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
do not allow limitations on how long an implied warranty lasts, so the above limitation may not apply to you.
CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING IN ANY WAY OUT OF THE SALE OF, USE
OF, OR INABILITY TO USE THE LOGITECH GAMING ARX CONTROL SDK OR ANY LOGITECH
PRODUCT OR SERVICE, EVEN IF LOGITECH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. IN NO CASE SHALL LOGITECH'S, ITS SUPPLIERS’ AND DISTRIBUTORS’ TOTAL LIABILITY
EXCEED THE ACTUAL MONEY PAID FOR THE LOGITECH PRODUCT OR SERVICE GIVING RISE TO
THE LIABILITY. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential
damages, so the above limitation or exclusion may not apply to you. The above limitations will not apply in
case of personal injury where and to the extent that applicable law requires such liability.
6 U.S. Government Rights. Use, duplication, or disclosure of the software contained in the Logitech Gaming
ARX CONTROL SDK by the U.S. Government is subject to restrictions set forth in this Agreement and as
provided in DFARS 227.7202-1(a) and 227.7202-3(a) (1995), DFARS 252.227-7013(c)(1)(ii) (OCT 1988)
FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14 (ALT III), as applicable. Logitech Inc. 7600
7 Export Law Assurances. You agree and certify that neither the Logitech Gaming ARX CONTROL SDK
nor any other technical data received from Logitech will be exported outside the United States except as
authorized and as permitted by the laws and regulations of the United States. If you have rightfully obtained
the Logitech Gaming ARX CONTROL SDK outside of the United States, you agree that you will not re-
export the Logitech Gaming ARX CONTROL SDK nor any other technical data received from Logitech,
Page 15
Logitech|G Arx Control SDK
except as permitted by the laws and regulations of the United States and the laws and regulations of the
jurisdiction in which you obtained the Logitech Gaming ARX CONTROL SDK.
8 Termination: This Agreement is effective until terminated. Upon any violation of any of the provisions of this
Agreement, or any provisions of any agreement between you and a Distributor, rights to use the Logitech
Gaming ARX CONTROL SDK shall automatically terminate and the Logitech Gaming ARX CONTROL SDK
must be returned to Logitech or all copies of the Logitech Gaming ARX CONTROL SDK destroyed. You may
also terminate this Agreement at any time by destroying all copies of the Logitech Gaming ARX CONTROL
SDK in your possession or control. If Logitech makes a request via public announcement or press release
to stop using the copies of the Logitech Gaming ARX CONTROL SDK, you will comply immediately with this
request. The provisions of paragraphs 3, 7, 8 and 12 will survive any termination of this Agreement.
9 General Terms and Conditions. If You are an individual signing this Agreement on behalf of a company,
then You represent that You have authority to execute this Agreement on behalf of such company. This
Agreement will be governed by and construed in accordance with the laws of the United States and the
State of California, without regard to or application of its choice of law rules or principles. If for any reason a
court of competent jurisdiction finds any provision of this Agreement, or portion thereof, to be unenforceable,
that provision of the Agreement shall be enforced to the maximum extent permissible so as to affect the
intent of the parties, and the remainder of this Agreement shall continue in full force and effect. This
Agreement constitutes the entire agreement between You and Logitech respect to the use of the Logitech
Gaming ARX CONTROL SDK and supersedes all prior or contemporaneous understandings,
Page 16