├── .gitignore ├── ELKM1DesktopApp └── ElkM1DesktopApp.csproj.user ├── ElkM1API.sln ├── ElkM1API ├── ElkC1M1Tunnel.cpp ├── ElkC1M1Tunnel.h ├── ElkM1API.h ├── ElkM1API.vcxproj ├── ElkM1API.vcxproj.filters ├── ElkM1AsciiAPI.cpp ├── ElkM1AsciiAPI.h ├── ElkM1Connection.cpp ├── ElkM1Connection.h ├── ElkM1Definition.h ├── ElkM1Monitor.cpp ├── ElkM1Monitor.h ├── ElkM1SirenWords.h ├── SwigCallbacks.cpp ├── SwigCallbacks.h ├── setup.py ├── swig.i ├── swig_wrap_csharp.cpp └── swig_wrap_csharp.h ├── ElkM1APITester ├── ElkM1APITester.vcxproj ├── ElkM1APITester.vcxproj.filters ├── ElkM1CLI.cpp ├── ElkM1TCP.cpp └── ElkM1TCP.h ├── ElkM1AndroidExample ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── elkm1androidexample │ │ │ └── elk │ │ │ └── org │ │ │ └── elkm1androidexample │ │ │ └── ApplicationTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ ├── elkm1androidexample │ │ │ │ └── elk │ │ │ │ │ └── org │ │ │ │ │ └── elkm1androidexample │ │ │ │ │ ├── ConnectionWrapper.java │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── SecureConnectionWrapper.java │ │ │ └── elkm1api │ │ │ │ ├── AlarmState.java │ │ │ │ ├── ArmMode.java │ │ │ │ ├── ArmStatus.java │ │ │ │ ├── ArmStatusVector.java │ │ │ │ ├── ArmStatusVectorCallback.java │ │ │ │ ├── ArmUpMode.java │ │ │ │ ├── AudioData.java │ │ │ │ ├── BoolCallback.java │ │ │ │ ├── BoolVector.java │ │ │ │ ├── C1M1Tunnel.java │ │ │ │ ├── CharVector.java │ │ │ │ ├── ChimeMode.java │ │ │ │ ├── ChimeModeVector.java │ │ │ │ ├── ElkM1API.java │ │ │ │ ├── ElkM1APIJNI.java │ │ │ │ ├── FKEY.java │ │ │ │ ├── IntCallback.java │ │ │ │ ├── IntVector.java │ │ │ │ ├── KeypadFkeyStatus.java │ │ │ │ ├── LogEntry.java │ │ │ │ ├── LogEntryVector.java │ │ │ │ ├── LogicalZoneState.java │ │ │ │ ├── M1API.java │ │ │ │ ├── M1AsciiAPI.java │ │ │ │ ├── M1Connection.java │ │ │ │ ├── M1Monitor.java │ │ │ │ ├── NetworkType.java │ │ │ │ ├── PhysicalZoneState.java │ │ │ │ ├── RTCData.java │ │ │ │ ├── SChimeMode.java │ │ │ │ ├── SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination.java │ │ │ │ ├── SZoneDefinition.java │ │ │ │ ├── SirenPhrase.java │ │ │ │ ├── SirenWord.java │ │ │ │ ├── SystemTroubleStatus.java │ │ │ │ ├── TempDevicePair.java │ │ │ │ ├── TempDevicePairVector.java │ │ │ │ ├── TemperatureDevice.java │ │ │ │ ├── TextDescriptionType.java │ │ │ │ ├── ThermostatData.java │ │ │ │ ├── UShortVector.java │ │ │ │ ├── UserCodeAccess.java │ │ │ │ ├── UserCodeSuccess.java │ │ │ │ ├── Weekday.java │ │ │ │ ├── ZoneDefinition.java │ │ │ │ ├── ZoneDefinitionVector.java │ │ │ │ ├── ZoneState.java │ │ │ │ ├── ZoneStateVector.java │ │ │ │ └── clearMethod.java │ │ ├── jni │ │ │ ├── swig_wrap_java.cpp │ │ │ └── swig_wrap_java.h │ │ └── res │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── elkm1androidexample │ │ └── elk │ │ └── org │ │ └── elkm1androidexample │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── swig-generate.sh ├── ElkM1DesktopApp ├── App.config ├── ElkM1Desktop.Designer.cs ├── ElkM1Desktop.cs ├── ElkM1Desktop.resx ├── ElkM1DesktopApp.csproj ├── M1ConnectionWrappers.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── Resources │ ├── armaway_image_c.png │ ├── armnight_image_c.png │ ├── armstay_image_c.png │ ├── disarm_image_c.png │ ├── off_symbol.png │ ├── on_symbol.png │ ├── zone_bypassed.png │ ├── zone_normal.png │ ├── zone_trouble.png │ └── zone_violated.png ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | Debug 3 | ElkM1DesktopApp/obj 4 | ElkM1APITester/Debug 5 | ElkM1API/Debug 6 | ElkM1API/build 7 | ElkM1API/ElkM1API.py 8 | ElkM1API/swig_wrap.cpp 9 | ElkM1API/swig_wrap.h 10 | ElkM1API/csharp 11 | ElkM1API.VC.opendb 12 | ElkM1API.sdf -------------------------------------------------------------------------------- /ELKM1DesktopApp/ElkM1DesktopApp.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | -------------------------------------------------------------------------------- /ElkM1API.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ElkM1API", "ElkM1API\ElkM1API.vcxproj", "{7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ElkM1APITester", "ElkM1APITester\ElkM1APITester.vcxproj", "{C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElkM1DesktopApp", "ElkM1DesktopApp\ElkM1DesktopApp.csproj", "{3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|Mixed Platforms = Debug|Mixed Platforms 16 | Debug|Win32 = Debug|Win32 17 | Release|Any CPU = Release|Any CPU 18 | Release|Mixed Platforms = Release|Mixed Platforms 19 | Release|Win32 = Release|Win32 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Debug|Any CPU.ActiveCfg = Debug|Win32 23 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 24 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 25 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Debug|Win32.ActiveCfg = Debug|Win32 26 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Debug|Win32.Build.0 = Debug|Win32 27 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Release|Any CPU.ActiveCfg = Release|Win32 28 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 29 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Release|Mixed Platforms.Build.0 = Release|Win32 30 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Release|Win32.ActiveCfg = Release|Win32 31 | {7EC94494-C89E-4B9F-A21F-9FF2025A2AF5}.Release|Win32.Build.0 = Release|Win32 32 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Debug|Any CPU.ActiveCfg = Debug|Win32 33 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 34 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 35 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Debug|Win32.ActiveCfg = Debug|Win32 36 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Debug|Win32.Build.0 = Debug|Win32 37 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Release|Any CPU.ActiveCfg = Release|Win32 38 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 39 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Release|Mixed Platforms.Build.0 = Release|Win32 40 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Release|Win32.ActiveCfg = Release|Win32 41 | {C7FB55F0-8E6B-4C05-97A0-C13DD0EFCEB0}.Release|Win32.Build.0 = Release|Win32 42 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 45 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 46 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Debug|Win32.ActiveCfg = Debug|Any CPU 47 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Release|Any CPU.ActiveCfg = Release|Any CPU 48 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Release|Any CPU.Build.0 = Release|Any CPU 49 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 50 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Release|Mixed Platforms.Build.0 = Release|Any CPU 51 | {3F8166B7-1CF5-4C38-B7AC-45749FA2BA13}.Release|Win32.ActiveCfg = Release|Any CPU 52 | EndGlobalSection 53 | GlobalSection(SolutionProperties) = preSolution 54 | HideSolutionNode = FALSE 55 | EndGlobalSection 56 | EndGlobal 57 | -------------------------------------------------------------------------------- /ElkM1API/ElkC1M1Tunnel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | @author Zach Jaggi 3 | */ 4 | 5 | #include "ElkC1M1Tunnel.h" 6 | #include 7 | 8 | namespace Elk { 9 | std::map C1M1Tunnel::jsonUglyParse(std::vector json) { 10 | // Do ugly parsing 11 | std::map uglyparse; 12 | auto startindex = std::find(json.begin(), json.end(), '{') != json.end() ? 13 | std::find(json.begin(), json.end(), '{') + 1: 14 | json.begin(); 15 | auto endindex = json.begin(); 16 | 17 | while (endindex != json.end()) { 18 | if (*endindex == '}' || *endindex == ','){ 19 | std::string key, value, property; 20 | property = std::string(startindex, endindex); 21 | const auto& keyEnd = std::find(property.begin(), property.end(), ':'); 22 | key = std::string(property.begin(), keyEnd); 23 | value = std::string(keyEnd + 1, property.end()); 24 | 25 | static const auto& trimquotes = [] (std::string& s) { 26 | if (s.front() == '"') { 27 | s.erase(0, 1); 28 | s.erase(s.end() - 1); 29 | } 30 | }; 31 | 32 | trimquotes(key); 33 | trimquotes(value); 34 | 35 | uglyparse.emplace(key, value); 36 | if (endindex != json.end()) 37 | startindex = endindex + 1; 38 | } 39 | endindex++; 40 | } 41 | return uglyparse; 42 | } 43 | // Method for authenticating an existing connection using a C1M1 authentication packet. 44 | void C1M1Tunnel::C1M1Authenticate(std::string username, std::string password, std::string sernum) { 45 | // Send authentication 46 | std::string authPacket = "{username:\"" 47 | + username 48 | + "\", password: \"" 49 | + password 50 | + "\", sernum:\"" 51 | + sernum 52 | + "\"}"; 53 | tunnel->Send(std::vector(authPacket.begin(), authPacket.end())); 54 | } 55 | 56 | std::vector C1M1Tunnel::RecieveCompleteJSON() { 57 | std::vector recv; 58 | do { 59 | const auto& app = tunnel->Recieve(); 60 | recv.insert(recv.end(), app.begin(), app.end()); 61 | } while (*recv.rbegin() != '}'); 62 | return recv; 63 | } 64 | 65 | NetworkType C1M1Tunnel::Authenticate(std::string username, std::string password, std::string sernum) { 66 | // Authenticate with manager 67 | C1M1Authenticate(username, password, sernum); 68 | // Loop till we have a full JSON Packet 69 | auto authPacket = jsonUglyParse(RecieveCompleteJSON()); 70 | if ((authPacket.find("AuthConnMask") != authPacket.end()) && (authPacket["AuthConnMask"] != "0")) { 71 | // We're authorized, continue connecting 72 | tunnel->Disconnect(); 73 | int colonPos = authPacket.at("ProxyUrl").find(':'); 74 | std::string url(authPacket.at("ProxyUrl").begin(), authPacket.at("ProxyUrl").begin() + colonPos); 75 | int port = std::stoi(std::string(authPacket.at("ProxyUrl").begin() + colonPos + 1, authPacket.at("ProxyUrl").end())); 76 | tunnel->Connect(url, port); 77 | C1M1Authenticate(username, password, sernum); 78 | // Get isValid 79 | authPacket = jsonUglyParse(RecieveCompleteJSON()); 80 | if ((authPacket.find("IsValid") != authPacket.end()) && (authPacket["IsValid"] != "0")) { 81 | // Get ActualConnMask 82 | authPacket = jsonUglyParse(RecieveCompleteJSON()); 83 | if (authPacket.find("ActualConnMask") != authPacket.end()) { 84 | return((NetworkType)(std::stoi(authPacket["ActualConnMask"]))); 85 | } 86 | } 87 | } 88 | return NETWORKTYPE_NONE; 89 | } 90 | 91 | C1M1Tunnel::C1M1Tunnel(M1Connection* underlying) : tunnel(underlying) { 92 | } 93 | 94 | C1M1Tunnel::~C1M1Tunnel() {} 95 | 96 | bool C1M1Tunnel::Connect(std::string location, int port) { 97 | return tunnel->Connect(location, port); 98 | } 99 | void C1M1Tunnel::Disconnect() { 100 | return tunnel->Disconnect(); 101 | } 102 | void C1M1Tunnel::Send(std::vector data) { 103 | return tunnel->Send(data); 104 | } 105 | std::vector C1M1Tunnel::Recieve() { 106 | return tunnel->Recieve(); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /ElkM1API/ElkC1M1Tunnel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ElkM1Connection.h: Provides the interface(s) for defining a connection to an M1. 3 | @author Zach Jaggi 4 | */ 5 | #pragma once 6 | 7 | #include "ElkM1Connection.h" 8 | 9 | 10 | namespace Elk { 11 | enum NetworkType { 12 | NETWORKTYPE_NONE = 0, 13 | NETWORKTYPE_ETHERNET = 1, 14 | NETWORKTYPE_CELLULAR = 2 15 | }; 16 | 17 | class C1M1Tunnel : private M1Connection 18 | { 19 | private: 20 | // Method for authenticating an existing connection using a C1M1 authentication packet. 21 | // TODO: First authentication is with server, which gets us the URL, seconds is with the client, which lets us connect. 22 | // Example first response: "{ProxyUrl:"www.elklink.com:8892", AuthConnMask:"3", OverDataBudget:True}" 23 | // Example second response: "{ActualConnMask:1}" 24 | // C1M1Dispatch contacts the proxy server and gets information 25 | std::vector RecieveCompleteJSON(); 26 | std::map jsonUglyParse(std::vector input); 27 | void C1M1Authenticate(std::string username, std::string password, std::string sernum); 28 | M1Connection* tunnel; 29 | public: 30 | ELKM1API C1M1Tunnel(M1Connection* underlying); 31 | virtual ELKM1API ~C1M1Tunnel(); 32 | ELKM1API NetworkType Authenticate(std::string username, std::string password, std::string sernum); 33 | ELKM1API bool Connect(std::string location, int port); 34 | ELKM1API void Disconnect(); 35 | ELKM1API void Send(std::vector data); 36 | ELKM1API std::vector Recieve(); 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /ElkM1API/ElkM1API.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | 64 | 65 | Source Files 66 | 67 | 68 | -------------------------------------------------------------------------------- /ElkM1API/ElkM1AsciiAPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | ElkM1AsciiAPI.h: Provides an extension of the M1API class to cover ASCII-specific functions. 3 | @author Zach Jaggi 4 | */ 5 | #pragma once 6 | #include "ElkM1Monitor.h" 7 | #include 8 | 9 | namespace Elk { 10 | class M1AsciiAPI : public M1Monitor { 11 | private: 12 | // TODO: Message could easily have an identifier/contents split. 13 | // Message for easy output/handle of ASCII messages 14 | class AsciiMessage{ 15 | std::string message; 16 | public: 17 | std::string to_string() { 18 | return message; 19 | } 20 | // Call to use as contents. 21 | AsciiMessage(std::vector& other) { 22 | // Calls copy constructor. 23 | std::vector cons(other); 24 | cons.push_back('\0'); 25 | message = std::string(&cons[0]); 26 | } 27 | AsciiMessage(const char *other) { 28 | message = std::string(other); 29 | } 30 | void push_back(char character) { 31 | message.push_back(character); 32 | } 33 | void operator+= (const char *other) { 34 | message += other; 35 | } 36 | void operator+= (std::string& other) { 37 | message += other; 38 | } 39 | void operator+= (std::vector other) { 40 | message.insert(message.end(), other.begin(), other.end()); 41 | } 42 | /* 43 | Call to create an instance of a class from a full packet. 44 | TODO: Check checksum and length portions. 45 | */ 46 | static AsciiMessage fromTransmission(std::vector other) { 47 | std::vector message; 48 | message.insert(message.begin(), other.begin() + 2, other.end() - 4); 49 | message.push_back('\0'); 50 | return AsciiMessage(message); 51 | } 52 | std::vector getTransmittable() const { 53 | std::vector nMessage(toAsciiHex(message.size() + 2, 2)); 54 | for (auto & c : message) 55 | nMessage.push_back(c); 56 | for (auto & c : genChecksum(nMessage)) 57 | nMessage.push_back(c); 58 | for (auto & c : {'\r', '\n'}) 59 | nMessage.push_back(c); 60 | return nMessage; 61 | } 62 | }; 63 | 64 | bool versionAtLeast(int major, int minor, int release); 65 | ELKM1API std::vector cutMessage(std::vector& buffer); 66 | ELKM1API void handleMessage(std::vector message); 67 | // Building a hashed function table allows things to be called in O(1) time. 68 | std::unordered_map < std::string, std::function> handleMessageTable; 69 | static std::vector genChecksum(const std::vector& message); 70 | static std::vector toAsciiHex(int value, int length); 71 | static std::vector toAsciiDec(int value, int length); 72 | void fillFunctionTable(); 73 | template 74 | T cacheRequest(M1Monitor::cacheObject& cacheObj, const AsciiMessage& request, bool ignoreCache, int timeoutMillis); 75 | template 76 | T cacheExistsRequest(M1Monitor::cacheObject& cacheObj, const AsciiMessage& request); 77 | public: 78 | ELKM1API M1AsciiAPI(std::shared_ptr conn); 79 | ELKM1API std::vector getLogs(); 80 | ELKM1API void collectNames(TextDescriptionType type); 81 | ELKM1API std::vector getConfiguredZones(); 82 | ELKM1API std::vector getConfiguredKeypads(); 83 | ELKM1API std::vector getConfiguredAreas(); 84 | ELKM1API std::vector> getConfiguredTempDevices(); 85 | ELKM1API Elk::AudioData getAudioData(int audioZone); 86 | ELKM1API bool setAreaBypass(int area, std::string pinCode, bool bypassed); 87 | ELKM1API void setLogData(int logType, int eventType, int zoneNumber, int area); 88 | ELKM1API bool zoneBypass(int zone, std::string pinCode); 89 | ELKM1API float getZoneVoltage(int zone); 90 | ELKM1API int getLightingStatus(int device); 91 | ELKM1API int getTemperature(Elk::TemperatureDevice type, int device); 92 | ELKM1API std::vector getTemperatures(Elk::TemperatureDevice type); 93 | ELKM1API Elk::KeypadFkeyStatus getKeypadFkeyStatus(int keypad); 94 | ELKM1API Elk::LogEntry getLogData(int index); 95 | ELKM1API std::vector getPLCStatus(int bank); 96 | ELKM1API Elk::RTCData getRTCData(); 97 | ELKM1API Elk::RTCData setRTCData(Elk::RTCData newData); 98 | ELKM1API std::vector getArmStatus(); 99 | ELKM1API std::vector getControlOutputs(); 100 | ELKM1API std::vector pressFunctionKey(int keypad, Elk::FKEY key); 101 | ELKM1API std::vector getKeypadAreas(); 102 | ELKM1API std::vector getZonePartitions(); 103 | ELKM1API std::vector getM1VersionNumber(); 104 | ELKM1API std::vector getXEPVersionNumber(); 105 | ELKM1API std::vector getCustomValues(); 106 | ELKM1API std::vector getZoneAlarms(); 107 | ELKM1API std::vector getZoneDefinitions(); 108 | ELKM1API std::vector getZoneStatuses(); 109 | ELKM1API std::string getTextDescription(Elk::TextDescriptionType type, int index); 110 | ELKM1API std::vector getOmnistat2Data(std::vector request); 111 | ELKM1API Elk::SystemTroubleStatus getSystemTroubleStatus(); 112 | ELKM1API Elk::ThermostatData getThermostatData(int index); 113 | ELKM1API Elk::ThermostatData setThermostatData(int index, int value, int element); 114 | ELKM1API uint16_t getCounterValue(int counter); 115 | ELKM1API uint16_t getCustomValue(int index); 116 | ELKM1API uint16_t setCounterValue(int counter, uint16_t value); 117 | ELKM1API Elk::UserCodeAccess getUserCodeAccess(std::string userCode); 118 | ELKM1API Elk::UserCodeSuccess requestChangeUserCode(int user, std::string authCode, std::string newUserCode, uint8_t areaMask); 119 | ELKM1API void activateTask(int taskNumber); 120 | ELKM1API void armDisarm(int partition, Elk::ArmMode mode, std::string userCode); 121 | ELKM1API void disableControlOutput(int output); 122 | ELKM1API void displayLCDText(int area, Elk::clearMethod clear, bool beepKeypad, uint16_t displayTime, std::string text); 123 | ELKM1API void displayLCDText(int area, Elk::clearMethod clear, bool beepKeypad, uint16_t displayTime, std::string lineOne, std::string lineTwo); 124 | ELKM1API void enableControlOutput(int output, uint16_t seconds); 125 | ELKM1API void executePLCCommand(char houseCode, int unitCode, int functionCode, int extendedCode, int timeOn); 126 | ELKM1API void setCustomValue(int index, uint16_t value); 127 | ELKM1API void setPLCState(char houseCode, int unitCode, bool state); 128 | ELKM1API void speakPhrase(Elk::SirenPhrase phrase); 129 | ELKM1API void speakWord(Elk::SirenWord word); 130 | ELKM1API void toggleControlOutput(int output); 131 | ELKM1API void togglePLCState(char houseCode, int unitCode); 132 | }; 133 | } 134 | -------------------------------------------------------------------------------- /ElkM1API/ElkM1Connection.cpp: -------------------------------------------------------------------------------- 1 | #include "ElkM1Connection.h" 2 | 3 | namespace Elk { 4 | 5 | M1Connection::~M1Connection() {} 6 | 7 | } -------------------------------------------------------------------------------- /ElkM1API/ElkM1Connection.h: -------------------------------------------------------------------------------- 1 | /* 2 | ElkM1Connection.h: Provides the interface(s) for defining a connection to an M1. 3 | @author Zach Jaggi 4 | */ 5 | #pragma once 6 | 7 | #ifdef _WIN32 8 | 9 | #ifdef ELKM1API_EXPORTS 10 | #define ELKM1API __declspec(dllexport) 11 | #else 12 | #define ELKM1API __declspec(dllimport) 13 | #endif 14 | #elif defined(__linux__) || defined(__CYGWIN__) 15 | #define ELKM1API 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | namespace Elk { 24 | // Used internally by the ElkM1Monitor class. 25 | // Deriving classes must block on the Recieve() call, and also block Send from occuring twice without us recieving anything, with an appropriate timeout. 26 | class M1Connection 27 | { 28 | public: 29 | virtual ELKM1API ~M1Connection(); 30 | virtual ELKM1API bool Connect(std::string location, int port) = 0; 31 | virtual ELKM1API void Disconnect() = 0; 32 | virtual ELKM1API void Send(std::vector data) = 0; 33 | virtual ELKM1API std::vector Recieve() = 0; // Recieve data into the buffer. Should block on this call. 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /ElkM1API/ElkM1Monitor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ElkM1Monitor.cpp: Provides an implementation of the M1Monitor cached M1 connection service class. 3 | @author Zach Jaggi 4 | */ 5 | 6 | #include "ElkM1Monitor.h" 7 | 8 | namespace Elk 9 | { 10 | M1Monitor::~M1Monitor() { 11 | stop(); 12 | } 13 | 14 | M1Monitor::M1Monitor(std::shared_ptr conn) { 15 | if (conn == nullptr) 16 | { 17 | throw std::invalid_argument("Connection must exist!"); 18 | } 19 | connection = conn; 20 | } 21 | 22 | void M1Monitor::run() { 23 | // Start the thread... 24 | executionThread = std::thread(&M1Monitor::_start, this); 25 | } 26 | 27 | void M1Monitor::stop() { 28 | sigStop = true; 29 | try { 30 | connection->Disconnect(); 31 | } 32 | catch (...) { 33 | // TODO: Cleanup 34 | } 35 | // Tell the execution thread to rejoin, if we aren't it 36 | if (std::this_thread::get_id() != executionThread.get_id()) 37 | executionThread.join(); 38 | m1cache.invalidate(); 39 | } 40 | 41 | void M1Monitor::_start() { 42 | sigStop = false; 43 | while (!sigStop) { 44 | // Block on ElkConnection::Recieve, Add new message to message buffer 45 | std::vector newData; 46 | try{ 47 | newData = connection->Recieve(); 48 | } 49 | // TODO: Cleaner implementation 50 | catch (...) { 51 | stop(); 52 | return; 53 | } 54 | buffer.insert(buffer.end(), newData.begin(), newData.end()); 55 | // TODO: Replace below with 'cutmessage' function 56 | bool noNewMessages = false; 57 | while (buffer.size() > 0 && !noNewMessages) { 58 | std::vector newMessage = cutMessage(buffer); 59 | noNewMessages = (newMessage.size() == 0); 60 | handleMessage(newMessage); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ElkM1API/SwigCallbacks.cpp: -------------------------------------------------------------------------------- 1 | #include "SwigCallbacks.h" 2 | 3 | IntCallback::~IntCallback() {} 4 | BoolCallback::~BoolCallback() {} 5 | ArmStatusVectorCallback::~ArmStatusVectorCallback() {} 6 | KeypadFkeyStatusCallback::~KeypadFkeyStatusCallback() {} 7 | BoolVectorCallback::~BoolVectorCallback() {} 8 | EntryExitTimeDataCallback::~EntryExitTimeDataCallback() {} 9 | LogEntryCallback::~LogEntryCallback() {} 10 | InvalidUserCodeDataCallback::~InvalidUserCodeDataCallback() {} 11 | ValidUserCodeDataCallback::~ValidUserCodeDataCallback() {} 12 | LightingDataCallback::~LightingDataCallback() {} 13 | X10DataCallback::~X10DataCallback() {} 14 | ZoneStateCallback::~ZoneStateCallback() {} 15 | StringCallback::~StringCallback() {} 16 | -------------------------------------------------------------------------------- /ElkM1API/SwigCallbacks.h: -------------------------------------------------------------------------------- 1 | /* 2 | SwigCallbacks.h: Provides some simple (static, untemplated) callback classes to allow wrapping of function callbacks 3 | for SWIG supported languages. 4 | */ 5 | #pragma once 6 | #include "ElkM1Definition.h" 7 | #include 8 | 9 | class BoolCallback { 10 | public: 11 | virtual ELKM1API void run(bool arg1) = 0; 12 | virtual ELKM1API ~BoolCallback() = 0; 13 | }; 14 | 15 | class IntCallback { 16 | public: 17 | virtual ELKM1API void run(int arg1) = 0; 18 | virtual ELKM1API ~IntCallback() = 0; 19 | }; 20 | 21 | class ArmStatusVectorCallback { 22 | public: 23 | virtual ELKM1API void run(std::vector status) = 0; 24 | virtual ELKM1API ~ArmStatusVectorCallback() = 0; 25 | }; 26 | 27 | class BoolVectorCallback { 28 | public: 29 | virtual ELKM1API void run(std::vector status) = 0; 30 | virtual ELKM1API ~BoolVectorCallback() = 0; 31 | }; 32 | 33 | class KeypadFkeyStatusCallback { 34 | public: 35 | virtual ELKM1API void run(Elk::KeypadFkeyStatus status) = 0; 36 | virtual ELKM1API ~KeypadFkeyStatusCallback() = 0; 37 | }; 38 | 39 | class EntryExitTimeDataCallback { 40 | public: 41 | virtual ELKM1API void run(Elk::EntryExitTimeData data) = 0; 42 | virtual ELKM1API ~EntryExitTimeDataCallback() = 0; 43 | }; 44 | 45 | class LogEntryCallback { 46 | public: 47 | virtual ELKM1API void run(Elk::LogEntry) = 0; 48 | virtual ELKM1API ~LogEntryCallback() = 0; 49 | }; 50 | 51 | class InvalidUserCodeDataCallback { 52 | public: 53 | virtual ELKM1API void run(Elk::InvalidUserCodeData) = 0; 54 | virtual ELKM1API ~InvalidUserCodeDataCallback() = 0; 55 | }; 56 | 57 | class ValidUserCodeDataCallback { 58 | public: 59 | virtual ELKM1API void run(Elk::ValidUserCodeData) = 0; 60 | virtual ELKM1API ~ValidUserCodeDataCallback() = 0; 61 | }; 62 | 63 | class LightingDataCallback { 64 | public: 65 | virtual ELKM1API void run(Elk::LightingData) = 0; 66 | virtual ELKM1API ~LightingDataCallback() = 0; 67 | }; 68 | 69 | class X10DataCallback { 70 | public: 71 | virtual ELKM1API void run(Elk::X10Data) = 0; 72 | virtual ELKM1API ~X10DataCallback() = 0; 73 | }; 74 | 75 | class ZoneStateCallback { 76 | public: 77 | virtual ELKM1API void run(Elk::ZoneState) = 0; 78 | virtual ELKM1API ~ZoneStateCallback() = 0; 79 | }; 80 | 81 | class StringCallback { 82 | public: 83 | virtual ELKM1API void run(std::string arg1) = 0; 84 | virtual ELKM1API ~StringCallback() = 0; 85 | }; -------------------------------------------------------------------------------- /ElkM1API/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from distutils.core import setup, Extension 4 | from textwrap import dedent 5 | 6 | elk_module = Extension( 7 | '_ElkM1API', 8 | sources=[ 9 | 'ElkC1M1Tunnel.cpp', 10 | 'ElkM1AsciiAPI.cpp', 11 | 'ElkM1Connection.cpp', 12 | 'ElkM1Monitor.cpp', 13 | 'SwigCallbacks.cpp', 14 | 'swig.i', 15 | ], 16 | swig_opts=['-DELKM1API', '-c++', '-py3'], 17 | extra_compile_args=['-std=c++11']) 18 | 19 | setup( 20 | name='ElkM1API', 21 | version='0.1', 22 | author='ELK PRODUCTS, INC.', 23 | license='MIT', 24 | description=dedent("""\ 25 | ElkM1API is a wrapper for the many functions that the Elk ASCII \ 26 | protocol that allows it to request information in a familiar \ 27 | environment, with everything wrapped down to simple calls.\ 28 | """), 29 | ext_modules=[elk_module], 30 | py_modules=['ElkM1API']) 31 | -------------------------------------------------------------------------------- /ElkM1API/swig.i: -------------------------------------------------------------------------------- 1 | /* File: swig.i 2 | * Description: Interface file for automatically generating SWIG modules. 3 | * More info: http://www.swig.org/tutorial.html 4 | */ 5 | %module(directors=1) ElkM1API 6 | %{ 7 | #include "ElkM1Definition.h" 8 | #include "SwigCallbacks.h" 9 | #include "ElkM1API.h" 10 | #include "ElkM1Monitor.h" 11 | #include "ElkM1AsciiAPI.h" 12 | #include "ElkM1Connection.h" 13 | #include "ElkM1SirenWords.h" 14 | #include "ElkC1M1Tunnel.h" 15 | %} 16 | %include "std_pair.i" 17 | %include "std_string.i" 18 | %include "std_vector.i" 19 | %include "std_shared_ptr.i" 20 | %include "stdint.i" 21 | %include "exception.i" 22 | 23 | // Set up things to have shared pointer passes 24 | %shared_ptr(Elk::ElkTCP) 25 | %shared_ptr(Elk::M1Connection) 26 | %shared_ptr(ArmStatusVectorCallback) 27 | %shared_ptr(StringCallback) 28 | %shared_ptr(EntryExitTimeDataCallback) 29 | %shared_ptr(InvalidUserCodeDataCallback) 30 | %shared_ptr(KeypadFkeyStatusCallback) 31 | %shared_ptr(LightingDataCallback) 32 | %shared_ptr(LogEntryCallback) 33 | %shared_ptr(BoolVectorCallback) 34 | %shared_ptr(BoolCallback) 35 | %shared_ptr(IntCallback) 36 | %shared_ptr(ValidUserCodeDataCallback) 37 | %shared_ptr(X10DataCallback) 38 | %shared_ptr(ZoneStateCallback) 39 | 40 | // This allows the C++ code to run calls that wind all the way up into the target platform code. 41 | %feature ("director") ArmStatusVectorCallback; 42 | %feature ("director") StringCallback; 43 | %feature ("director") EntryExitTimeDataCallback; 44 | %feature ("director") InvalidUserCodeDataCallback; 45 | %feature ("director") KeypadFkeyStatusCallback; 46 | %feature ("director") LightingDataCallback; 47 | %feature ("director") LogEntryCallback; 48 | %feature ("director") BoolVectorCallback; 49 | %feature ("director") BoolCallback; 50 | %feature ("director") IntCallback; 51 | %feature ("director") ValidUserCodeDataCallback; 52 | %feature ("director") X10DataCallback; 53 | %feature ("director") ZoneStateCallback; 54 | 55 | // This allows us to make the M1Connection calls against a derived target-language class, so we can 56 | // implement the connection on the target platform (such as SSL encrypted on Android) 57 | %feature ("director") M1Connection; 58 | %feature ("director") C1M1Tunnel; 59 | 60 | // Set up things passed by vector 61 | %template(BoolVector) std::vector; 62 | %template(CharVector) std::vector; 63 | %template(IntVector) std::vector; 64 | %template(UShortVector) std::vector; 65 | 66 | %template(LogEntryVector) std::vector; 67 | %template(ArmStatusVector) std::vector; 68 | %template(ZoneStateVector) std::vector; 69 | 70 | %template(TempDevicePair) std::pair; 71 | %template(TempDevicePairVector) std::vector>; 72 | 73 | // Vector of enums needs special handling, use a single-element struct instead 74 | %template(ChimeModeVector) std::vector; 75 | %template(ZoneDefinitionVector) std::vector; 76 | 77 | %include "ElkM1Definition.h" 78 | %include "SwigCallbacks.h" 79 | %include "ElkM1API.h" 80 | %include "ElkM1Monitor.h" 81 | %include "ElkM1AsciiAPI.h" 82 | %include "ElkM1Connection.h" 83 | %include "ElkM1SirenWords.h" 84 | %include "ElkC1M1Tunnel.h" 85 | 86 | // Using this, STL exceptions bubble up to end-user code 87 | %exception { 88 | try { 89 | $action 90 | } catch (const std::exception& e) { 91 | SWIG_exception(SWIG_RuntimeError, e.what()); 92 | } 93 | } -------------------------------------------------------------------------------- /ElkM1APITester/ElkM1APITester.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /ElkM1APITester/ElkM1TCP.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ElkM1TCP.cpp: Provides an implementation of M1 TCP Connection 3 | @author Zach Jaggi 4 | */ 5 | #include "ElkM1TCP.h" 6 | 7 | namespace Elk 8 | { 9 | ElkTCP::~ElkTCP() {} 10 | 11 | bool ElkTCP::Connect(std::string address, int port) { 12 | 13 | #ifdef _WIN32 14 | WSADATA wsadata; 15 | int error = WSAStartup(0x0202, &wsadata); 16 | 17 | if (error) return false; 18 | 19 | if (wsadata.wVersion != 0x0202) 20 | { 21 | WSACleanup(); 22 | return false; 23 | } 24 | #endif 25 | SOCKADDR_IN target; 26 | target.sin_family = AF_INET; 27 | target.sin_port = htons(port); 28 | target.sin_addr.s_addr = inet_addr(address.c_str()); 29 | 30 | sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); 31 | 32 | if (sock == INVALID_SOCKET) return false; 33 | 34 | return connect(sock, (SOCKADDR*)&target, sizeof(target)) != SOCKET_ERROR; 35 | } 36 | 37 | void ElkTCP::Disconnect() { 38 | if (sock) { 39 | #ifdef _WIN32 40 | int error = closesocket(sock); 41 | #elif __linux__ 42 | int error = close(sock); 43 | #endif 44 | if (error) { 45 | #ifdef _WIN32 46 | throw WSAGetLastError(); 47 | #elif __linux__ 48 | throw errno; 49 | #endif 50 | } 51 | } 52 | #ifdef _WIN32 53 | WSACleanup(); 54 | #endif 55 | } 56 | 57 | void ElkTCP::Send(std::vector data) { 58 | int bytes_recieved_or_error = send(sock, &data[0], data.size(), 0); 59 | if (bytes_recieved_or_error == SOCKET_ERROR) { 60 | #ifdef _WIN32 61 | throw WSAGetLastError(); 62 | #elif __linux__ 63 | throw errno; 64 | #endif 65 | } 66 | } 67 | 68 | std::vector ElkTCP::Recieve() { 69 | std::vector data(4096); 70 | int bytes_recieved_or_error = recv(sock, &data[0], data.size(), 0); 71 | if (bytes_recieved_or_error != SOCKET_ERROR) { 72 | data.resize(bytes_recieved_or_error); 73 | return data; 74 | } 75 | else { 76 | #ifdef _WIN32 77 | throw WSAGetLastError(); 78 | #elif __linux__ 79 | throw errno; 80 | #endif 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /ElkM1APITester/ElkM1TCP.h: -------------------------------------------------------------------------------- 1 | /* 2 | ElkM1TCP.h: Provides C++-only access to an unsecure TCP connection. Not exported with SWIG 3 | @author Zach Jaggi 4 | */ 5 | #pragma once 6 | #include "ElkM1Connection.h" 7 | 8 | #ifdef _WIN32 9 | #include 10 | #pragma comment(lib, "wsock32.lib") 11 | #elif __linux__ 12 | #include 13 | #include 14 | #include 15 | #include 16 | #define SOCKET int 17 | #define SOCKADDR_IN sockaddr_in 18 | #define SOCKADDR sockaddr 19 | #define SOCKET_ERROR -1 20 | #define INVALID_SOCKET -1 21 | #endif 22 | 23 | namespace Elk{ 24 | 25 | class ElkTCP : public M1Connection { 26 | private: 27 | SOCKET sock; 28 | public: 29 | ~ElkTCP(); 30 | bool Connect(std::string address, int port); 31 | void Disconnect(); 32 | void Send(std::vector data); 33 | std::vector Recieve(); 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/.name: -------------------------------------------------------------------------------- 1 | ElkM1AndroidExample -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.1" 6 | 7 | defaultConfig { 8 | applicationId "elkm1androidexample.elk.org.elkm1androidexample" 9 | minSdkVersion 15 10 | targetSdkVersion 24 11 | versionCode 1 12 | versionName "1.0" 13 | ndk { 14 | moduleName "elkm1api" 15 | stl "c++_shared" 16 | cFlags "-std=c++11 -fexceptions -frtti -I" + file("src/../../../ElkM1API").absolutePath 17 | ldLibs = ['log'] 18 | } 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 24 | ndk { 25 | debuggable = true 26 | } 27 | } 28 | debug { 29 | debuggable = true 30 | jniDebuggable = true 31 | } 32 | } 33 | sourceSets.main { 34 | jni.srcDirs = ['src/main/jni', 'src/../../../ElkM1API'] 35 | } 36 | } 37 | 38 | dependencies { 39 | compile fileTree(dir: 'libs', include: ['*.jar']) 40 | testCompile 'junit:junit:4.12' 41 | compile 'com.android.support:appcompat-v7:24.1.1' 42 | } 43 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/feilen/.Android/Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/androidTest/java/elkm1androidexample/elk/org/elkm1androidexample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package elkm1androidexample.elk.org.elkm1androidexample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1androidexample/elk/org/elkm1androidexample/ConnectionWrapper.java: -------------------------------------------------------------------------------- 1 | package elkm1androidexample.elk.org.elkm1androidexample; 2 | 3 | import elkm1api.CharVector; 4 | import elkm1api.M1Connection; 5 | 6 | import java.io.IOException; 7 | import java.net.Socket; 8 | 9 | /** 10 | * Created by feilen on 8/10/16. 11 | */ 12 | public class ConnectionWrapper extends M1Connection { 13 | protected Socket tcp; 14 | //AutoResetEvent evt = new AutoResetEvent(true); 15 | 16 | public boolean Connect(String location, int port) 17 | { 18 | try { 19 | tcp = new Socket(location, port); 20 | return tcp.isConnected(); 21 | } catch (IOException ioe) { 22 | return false; 23 | } 24 | } 25 | 26 | public CharVector Recieve() 27 | { 28 | byte[] recv = new byte[256]; 29 | int recieved = 0; 30 | try { 31 | recieved = tcp.getInputStream().read(recv, 0, recv.length); 32 | } catch (IOException ioe) { 33 | 34 | } 35 | //evt.Set(); 36 | CharVector cv = new CharVector(recieved); 37 | for (int i = 0; i < recieved; i++) 38 | { 39 | cv.add((char)recv[i]); 40 | } 41 | return cv; 42 | 43 | } 44 | 45 | public void Send(CharVector data) 46 | { 47 | byte[] send = new byte[(int)data.size()]; 48 | for (int i = 0; i < data.size(); i++) 49 | send[i] = (byte)data.get(i); 50 | //evt.WaitOne(300); 51 | // TODO: Rate limiting 52 | try { 53 | tcp.getOutputStream().write(send, 0, (int)data.size()); 54 | } catch (IOException ioe) { 55 | 56 | } 57 | //Console.WriteLine(Encoding.ASCII.GetString(send, 0, data.Count)); 58 | } 59 | 60 | public void Disconnect() 61 | { 62 | // evt.set(); 63 | try { 64 | tcp.close(); 65 | } catch (IOException ioe) { 66 | // 67 | } 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1androidexample/elk/org/elkm1androidexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package elkm1androidexample.elk.org.elkm1androidexample; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | import android.widget.TextView; 8 | 9 | import elkm1api.C1M1Tunnel; 10 | import elkm1api.IntVector; 11 | import elkm1api.M1AsciiAPI; 12 | import elkm1api.NetworkType; 13 | 14 | public class MainActivity extends AppCompatActivity { 15 | 16 | static { 17 | System.loadLibrary("elkm1api"); 18 | } 19 | 20 | SecureConnectionWrapper cw; 21 | M1AsciiAPI m1api; 22 | C1M1Tunnel tunn; 23 | boolean connected = false; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.activity_main); 30 | 31 | } 32 | 33 | public void onConnectClick(View v) { 34 | final Button button = (Button)v; 35 | // Create ConnectionWrapper 36 | if(!connected) { 37 | new Thread(){ 38 | public void run() { 39 | cw = new SecureConnectionWrapper(); 40 | 41 | // ((TextView)this.findViewById(R.id.AddressEnter)).getText().toString() 42 | 43 | if(cw.Connect("dev.elklink.com", 8891)) { 44 | 45 | tunn = new C1M1Tunnel(cw); 46 | if (tunn.Authenticate("USERNAME", "PASSWORD", "SERNUM") != NetworkType.NETWORKTYPE_NONE) 47 | { 48 | // Create M1AsciiAPI(cs) 49 | 50 | m1api = new M1AsciiAPI(cw); 51 | 52 | // Run m1.run(); 53 | m1api.run(); 54 | final IntVector version = m1api.getM1VersionNumber(); 55 | runOnUiThread(new Runnable() { 56 | @Override 57 | public void run() { 58 | ((TextView)findViewById(R.id.textView)).setText(version.get(0) + "." + version.get(1) + "." + version.get(2)); 59 | } 60 | }); 61 | 62 | button.setText("Disconnect"); 63 | connected = true; 64 | 65 | } else 66 | { 67 | runOnUiThread(new Runnable() { 68 | @Override 69 | public void run() { 70 | ((TextView)findViewById(R.id.textView)).setText("failed to authenticate!"); 71 | } 72 | }); 73 | } 74 | } else { 75 | runOnUiThread(new Runnable() { 76 | @Override 77 | public void run() { 78 | ((TextView)findViewById(R.id.textView)).setText("failed to connect!"); 79 | } 80 | }); 81 | 82 | } 83 | } 84 | }.start(); 85 | } else { 86 | m1api.stop(); 87 | cw.Disconnect(); 88 | button.setText("Connect"); 89 | ((TextView)this.findViewById(R.id.textView)).setText(""); 90 | connected = false; 91 | } 92 | } 93 | 94 | public void onGetClick(View v) { 95 | Button button = (Button)v; 96 | 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1androidexample/elk/org/elkm1androidexample/SecureConnectionWrapper.java: -------------------------------------------------------------------------------- 1 | package elkm1androidexample.elk.org.elkm1androidexample; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.BufferedInputStream; 6 | import java.io.IOException; 7 | import java.net.Socket; 8 | 9 | import javax.net.SocketFactory; 10 | import javax.net.ssl.HostnameVerifier; 11 | import javax.net.ssl.HttpsURLConnection; 12 | import javax.net.ssl.SSLSession; 13 | import javax.net.ssl.SSLSocket; 14 | import javax.net.ssl.SSLSocketFactory; 15 | 16 | import elkm1api.CharVector; 17 | import elkm1api.M1Connection; 18 | 19 | /** 20 | * Created by feilen on 8/10/16. 21 | */ 22 | public class SecureConnectionWrapper extends M1Connection { 23 | protected SSLSocket ssltcp; 24 | protected BufferedInputStream bis; 25 | //AutoResetEvent evt = new AutoResetEvent(true); 26 | 27 | public boolean Connect(String location, int port) { 28 | try { 29 | // Largely from https://developer.android.com/training/articles/security-ssl.html 30 | SocketFactory sf = SSLSocketFactory.getDefault(); 31 | ssltcp = (SSLSocket) sf.createSocket(location, port); 32 | HostnameVerifier hv = HttpsURLConnection.getDefaultHostnameVerifier(); 33 | SSLSession s = ssltcp.getSession(); 34 | 35 | if (!hv.verify(location, s)) { 36 | ssltcp.close(); 37 | return false; 38 | } 39 | 40 | bis = new BufferedInputStream(ssltcp.getInputStream()); 41 | 42 | return ssltcp.isConnected(); 43 | } catch (IOException ioe) { 44 | return false; 45 | } 46 | } 47 | 48 | public CharVector Recieve() { 49 | byte[] recv = new byte[256]; 50 | int recieved = 0; 51 | try { 52 | recieved = bis.read(recv, 0, recv.length); 53 | } catch (IOException ioe) { 54 | Log.v("Recieved", "Error recieving: " + ioe.toString()); 55 | } 56 | //evt.Set(); 57 | CharVector cv = new CharVector(recieved); 58 | Log.v("Recieved", new String(recv, 0, recieved)); 59 | 60 | for (int i = 0; i < recieved; i++) { 61 | cv.add((char) recv[i]); 62 | } 63 | return cv; 64 | } 65 | 66 | public void Send(CharVector data) { 67 | byte[] send = new byte[(int) data.size()]; 68 | for (int i = 0; i < data.size(); i++) 69 | send[i] = (byte) data.get(i); 70 | //evt.WaitOne(300); 71 | // TODO: Rate limiting 72 | try { 73 | ssltcp.getOutputStream().write(send, 0, (int) data.size()); 74 | ssltcp.getOutputStream().flush(); 75 | Log.v("Sent", new String(send, 0, (int) data.size())); 76 | } catch (IOException ioe) { 77 | Log.v("Sent", "Error while sending: " + ioe.toString()); 78 | } 79 | //Console.WriteLine(Encoding.ASCII.GetString(send, 0, data.Count)); 80 | } 81 | 82 | public void Disconnect() { 83 | // evt.set(); 84 | try { 85 | ssltcp.close(); 86 | } catch (IOException ioe) { 87 | Log.v("Sent", ioe.toString()); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/AlarmState.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class AlarmState { 12 | public final static AlarmState ALARMSTATE_NONE = new AlarmState("ALARMSTATE_NONE", ElkM1APIJNI.ALARMSTATE_NONE_get()); 13 | public final static AlarmState ALARMSTATE_ENTRANCE_DELAY = new AlarmState("ALARMSTATE_ENTRANCE_DELAY", ElkM1APIJNI.ALARMSTATE_ENTRANCE_DELAY_get()); 14 | public final static AlarmState ALARMSTATE_ALARM_ABORT_DELAY = new AlarmState("ALARMSTATE_ALARM_ABORT_DELAY", ElkM1APIJNI.ALARMSTATE_ALARM_ABORT_DELAY_get()); 15 | public final static AlarmState ALARMSTATE_FIRE = new AlarmState("ALARMSTATE_FIRE", ElkM1APIJNI.ALARMSTATE_FIRE_get()); 16 | public final static AlarmState ALARMSTATE_MEDICAL = new AlarmState("ALARMSTATE_MEDICAL", ElkM1APIJNI.ALARMSTATE_MEDICAL_get()); 17 | public final static AlarmState ALARMSTATE_POLICE = new AlarmState("ALARMSTATE_POLICE", ElkM1APIJNI.ALARMSTATE_POLICE_get()); 18 | public final static AlarmState ALARMSTATE_BURGLAR = new AlarmState("ALARMSTATE_BURGLAR", ElkM1APIJNI.ALARMSTATE_BURGLAR_get()); 19 | public final static AlarmState ALARMSTATE_AUX1 = new AlarmState("ALARMSTATE_AUX1", ElkM1APIJNI.ALARMSTATE_AUX1_get()); 20 | public final static AlarmState ALARMSTATE_AUX2 = new AlarmState("ALARMSTATE_AUX2", ElkM1APIJNI.ALARMSTATE_AUX2_get()); 21 | public final static AlarmState ALARMSTATE_AUX3 = new AlarmState("ALARMSTATE_AUX3", ElkM1APIJNI.ALARMSTATE_AUX3_get()); 22 | public final static AlarmState ALARMSTATE_AUX4 = new AlarmState("ALARMSTATE_AUX4", ElkM1APIJNI.ALARMSTATE_AUX4_get()); 23 | public final static AlarmState ALARMSTATE_CARBON_MONOXIDE = new AlarmState("ALARMSTATE_CARBON_MONOXIDE", ElkM1APIJNI.ALARMSTATE_CARBON_MONOXIDE_get()); 24 | public final static AlarmState ALARMSTATE_EMERGENCY = new AlarmState("ALARMSTATE_EMERGENCY", ElkM1APIJNI.ALARMSTATE_EMERGENCY_get()); 25 | public final static AlarmState ALARMSTATE_FREEZE = new AlarmState("ALARMSTATE_FREEZE", ElkM1APIJNI.ALARMSTATE_FREEZE_get()); 26 | public final static AlarmState ALARMSTATE_GAS = new AlarmState("ALARMSTATE_GAS", ElkM1APIJNI.ALARMSTATE_GAS_get()); 27 | public final static AlarmState ALARMSTATE_HEAT = new AlarmState("ALARMSTATE_HEAT", ElkM1APIJNI.ALARMSTATE_HEAT_get()); 28 | public final static AlarmState ALARMSTATE_WATER = new AlarmState("ALARMSTATE_WATER", ElkM1APIJNI.ALARMSTATE_WATER_get()); 29 | public final static AlarmState ALARMSTATE_FIRE_SUPERVISORY = new AlarmState("ALARMSTATE_FIRE_SUPERVISORY", ElkM1APIJNI.ALARMSTATE_FIRE_SUPERVISORY_get()); 30 | public final static AlarmState ALARMSTATE_VERIFY_FIRE = new AlarmState("ALARMSTATE_VERIFY_FIRE", ElkM1APIJNI.ALARMSTATE_VERIFY_FIRE_get()); 31 | 32 | public final int swigValue() { 33 | return swigValue; 34 | } 35 | 36 | public String toString() { 37 | return swigName; 38 | } 39 | 40 | public static AlarmState swigToEnum(int swigValue) { 41 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 42 | return swigValues[swigValue]; 43 | for (int i = 0; i < swigValues.length; i++) 44 | if (swigValues[i].swigValue == swigValue) 45 | return swigValues[i]; 46 | throw new IllegalArgumentException("No enum " + AlarmState.class + " with value " + swigValue); 47 | } 48 | 49 | private AlarmState(String swigName) { 50 | this.swigName = swigName; 51 | this.swigValue = swigNext++; 52 | } 53 | 54 | private AlarmState(String swigName, int swigValue) { 55 | this.swigName = swigName; 56 | this.swigValue = swigValue; 57 | swigNext = swigValue+1; 58 | } 59 | 60 | private AlarmState(String swigName, AlarmState swigEnum) { 61 | this.swigName = swigName; 62 | this.swigValue = swigEnum.swigValue; 63 | swigNext = this.swigValue+1; 64 | } 65 | 66 | private static AlarmState[] swigValues = { ALARMSTATE_NONE, ALARMSTATE_ENTRANCE_DELAY, ALARMSTATE_ALARM_ABORT_DELAY, ALARMSTATE_FIRE, ALARMSTATE_MEDICAL, ALARMSTATE_POLICE, ALARMSTATE_BURGLAR, ALARMSTATE_AUX1, ALARMSTATE_AUX2, ALARMSTATE_AUX3, ALARMSTATE_AUX4, ALARMSTATE_CARBON_MONOXIDE, ALARMSTATE_EMERGENCY, ALARMSTATE_FREEZE, ALARMSTATE_GAS, ALARMSTATE_HEAT, ALARMSTATE_WATER, ALARMSTATE_FIRE_SUPERVISORY, ALARMSTATE_VERIFY_FIRE }; 67 | private static int swigNext = 0; 68 | private final int swigValue; 69 | private final String swigName; 70 | } 71 | 72 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ArmMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class ArmMode { 12 | public final static ArmMode ARM_DISARMED = new ArmMode("ARM_DISARMED", ElkM1APIJNI.ARM_DISARMED_get()); 13 | public final static ArmMode ARM_AWAY = new ArmMode("ARM_AWAY", ElkM1APIJNI.ARM_AWAY_get()); 14 | public final static ArmMode ARM_STAY = new ArmMode("ARM_STAY", ElkM1APIJNI.ARM_STAY_get()); 15 | public final static ArmMode ARM_STAYINSTANT = new ArmMode("ARM_STAYINSTANT", ElkM1APIJNI.ARM_STAYINSTANT_get()); 16 | public final static ArmMode ARM_NIGHT = new ArmMode("ARM_NIGHT", ElkM1APIJNI.ARM_NIGHT_get()); 17 | public final static ArmMode ARM_NIGHTINSTANT = new ArmMode("ARM_NIGHTINSTANT", ElkM1APIJNI.ARM_NIGHTINSTANT_get()); 18 | public final static ArmMode ARM_VACATION = new ArmMode("ARM_VACATION", ElkM1APIJNI.ARM_VACATION_get()); 19 | public final static ArmMode ARM_AWAYNEXT = new ArmMode("ARM_AWAYNEXT", ElkM1APIJNI.ARM_AWAYNEXT_get()); 20 | public final static ArmMode ARM_STAYNEXT = new ArmMode("ARM_STAYNEXT", ElkM1APIJNI.ARM_STAYNEXT_get()); 21 | 22 | public final int swigValue() { 23 | return swigValue; 24 | } 25 | 26 | public String toString() { 27 | return swigName; 28 | } 29 | 30 | public static ArmMode swigToEnum(int swigValue) { 31 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 32 | return swigValues[swigValue]; 33 | for (int i = 0; i < swigValues.length; i++) 34 | if (swigValues[i].swigValue == swigValue) 35 | return swigValues[i]; 36 | throw new IllegalArgumentException("No enum " + ArmMode.class + " with value " + swigValue); 37 | } 38 | 39 | private ArmMode(String swigName) { 40 | this.swigName = swigName; 41 | this.swigValue = swigNext++; 42 | } 43 | 44 | private ArmMode(String swigName, int swigValue) { 45 | this.swigName = swigName; 46 | this.swigValue = swigValue; 47 | swigNext = swigValue+1; 48 | } 49 | 50 | private ArmMode(String swigName, ArmMode swigEnum) { 51 | this.swigName = swigName; 52 | this.swigValue = swigEnum.swigValue; 53 | swigNext = this.swigValue+1; 54 | } 55 | 56 | private static ArmMode[] swigValues = { ARM_DISARMED, ARM_AWAY, ARM_STAY, ARM_STAYINSTANT, ARM_NIGHT, ARM_NIGHTINSTANT, ARM_VACATION, ARM_AWAYNEXT, ARM_STAYNEXT }; 57 | private static int swigNext = 0; 58 | private final int swigValue; 59 | private final String swigName; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ArmStatus.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ArmStatus { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ArmStatus(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ArmStatus obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ArmStatus(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setMode(ArmMode value) { 39 | ElkM1APIJNI.ArmStatus_mode_set(swigCPtr, this, value.swigValue()); 40 | } 41 | 42 | public ArmMode getMode() { 43 | return ArmMode.swigToEnum(ElkM1APIJNI.ArmStatus_mode_get(swigCPtr, this)); 44 | } 45 | 46 | public void setIsReady(ArmUpMode value) { 47 | ElkM1APIJNI.ArmStatus_isReady_set(swigCPtr, this, value.swigValue()); 48 | } 49 | 50 | public ArmUpMode getIsReady() { 51 | return ArmUpMode.swigToEnum(ElkM1APIJNI.ArmStatus_isReady_get(swigCPtr, this)); 52 | } 53 | 54 | public void setAlarm(AlarmState value) { 55 | ElkM1APIJNI.ArmStatus_alarm_set(swigCPtr, this, value.swigValue()); 56 | } 57 | 58 | public AlarmState getAlarm() { 59 | return AlarmState.swigToEnum(ElkM1APIJNI.ArmStatus_alarm_get(swigCPtr, this)); 60 | } 61 | 62 | public ArmStatus() { 63 | this(ElkM1APIJNI.new_ArmStatus(), true); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ArmStatusVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ArmStatusVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ArmStatusVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ArmStatusVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ArmStatusVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public ArmStatusVector() { 39 | this(ElkM1APIJNI.new_ArmStatusVector__SWIG_0(), true); 40 | } 41 | 42 | public ArmStatusVector(long n) { 43 | this(ElkM1APIJNI.new_ArmStatusVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.ArmStatusVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.ArmStatusVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.ArmStatusVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.ArmStatusVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.ArmStatusVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(ArmStatus x) { 67 | ElkM1APIJNI.ArmStatusVector_add(swigCPtr, this, ArmStatus.getCPtr(x), x); 68 | } 69 | 70 | public ArmStatus get(int i) { 71 | return new ArmStatus(ElkM1APIJNI.ArmStatusVector_get(swigCPtr, this, i), false); 72 | } 73 | 74 | public void set(int i, ArmStatus val) { 75 | ElkM1APIJNI.ArmStatusVector_set(swigCPtr, this, i, ArmStatus.getCPtr(val), val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ArmStatusVectorCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ArmStatusVectorCallback { 12 | private transient long swigCPtr; 13 | private transient boolean swigCMemOwn; 14 | 15 | protected ArmStatusVectorCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ArmStatusVectorCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ArmStatusVectorCallback(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | ElkM1APIJNI.ArmStatusVectorCallback_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | ElkM1APIJNI.ArmStatusVectorCallback_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public void run(ArmStatusVector status) { 54 | ElkM1APIJNI.ArmStatusVectorCallback_run(swigCPtr, this, ArmStatusVector.getCPtr(status), status); 55 | } 56 | 57 | public ArmStatusVectorCallback() { 58 | this(ElkM1APIJNI.new_ArmStatusVectorCallback(), true); 59 | ElkM1APIJNI.ArmStatusVectorCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ArmUpMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class ArmUpMode { 12 | public final static ArmUpMode ARMUPMODE_NOTREADY = new ArmUpMode("ARMUPMODE_NOTREADY", ElkM1APIJNI.ARMUPMODE_NOTREADY_get()); 13 | public final static ArmUpMode ARMUPMODE_READY = new ArmUpMode("ARMUPMODE_READY", ElkM1APIJNI.ARMUPMODE_READY_get()); 14 | public final static ArmUpMode ARMUPMODE_READYFORCE = new ArmUpMode("ARMUPMODE_READYFORCE", ElkM1APIJNI.ARMUPMODE_READYFORCE_get()); 15 | public final static ArmUpMode ARMUPMODE_ARMEDEXITTIMER = new ArmUpMode("ARMUPMODE_ARMEDEXITTIMER", ElkM1APIJNI.ARMUPMODE_ARMEDEXITTIMER_get()); 16 | public final static ArmUpMode ARMUPMODE_ARMED = new ArmUpMode("ARMUPMODE_ARMED", ElkM1APIJNI.ARMUPMODE_ARMED_get()); 17 | public final static ArmUpMode ARMUPMODE_ARMEDFORCE = new ArmUpMode("ARMUPMODE_ARMEDFORCE", ElkM1APIJNI.ARMUPMODE_ARMEDFORCE_get()); 18 | public final static ArmUpMode ARMUPMODE_ARMEDBYPASS = new ArmUpMode("ARMUPMODE_ARMEDBYPASS", ElkM1APIJNI.ARMUPMODE_ARMEDBYPASS_get()); 19 | 20 | public final int swigValue() { 21 | return swigValue; 22 | } 23 | 24 | public String toString() { 25 | return swigName; 26 | } 27 | 28 | public static ArmUpMode swigToEnum(int swigValue) { 29 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 30 | return swigValues[swigValue]; 31 | for (int i = 0; i < swigValues.length; i++) 32 | if (swigValues[i].swigValue == swigValue) 33 | return swigValues[i]; 34 | throw new IllegalArgumentException("No enum " + ArmUpMode.class + " with value " + swigValue); 35 | } 36 | 37 | private ArmUpMode(String swigName) { 38 | this.swigName = swigName; 39 | this.swigValue = swigNext++; 40 | } 41 | 42 | private ArmUpMode(String swigName, int swigValue) { 43 | this.swigName = swigName; 44 | this.swigValue = swigValue; 45 | swigNext = swigValue+1; 46 | } 47 | 48 | private ArmUpMode(String swigName, ArmUpMode swigEnum) { 49 | this.swigName = swigName; 50 | this.swigValue = swigEnum.swigValue; 51 | swigNext = this.swigValue+1; 52 | } 53 | 54 | private static ArmUpMode[] swigValues = { ARMUPMODE_NOTREADY, ARMUPMODE_READY, ARMUPMODE_READYFORCE, ARMUPMODE_ARMEDEXITTIMER, ARMUPMODE_ARMED, ARMUPMODE_ARMEDFORCE, ARMUPMODE_ARMEDBYPASS }; 55 | private static int swigNext = 0; 56 | private final int swigValue; 57 | private final String swigName; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/AudioData.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class AudioData { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected AudioData(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(AudioData obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_AudioData(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setZoneIsOn(boolean value) { 39 | ElkM1APIJNI.AudioData_zoneIsOn_set(swigCPtr, this, value); 40 | } 41 | 42 | public boolean getZoneIsOn() { 43 | return ElkM1APIJNI.AudioData_zoneIsOn_get(swigCPtr, this); 44 | } 45 | 46 | public void setLoudness(boolean value) { 47 | ElkM1APIJNI.AudioData_loudness_set(swigCPtr, this, value); 48 | } 49 | 50 | public boolean getLoudness() { 51 | return ElkM1APIJNI.AudioData_loudness_get(swigCPtr, this); 52 | } 53 | 54 | public void setDoNotDisturb(boolean value) { 55 | ElkM1APIJNI.AudioData_doNotDisturb_set(swigCPtr, this, value); 56 | } 57 | 58 | public boolean getDoNotDisturb() { 59 | return ElkM1APIJNI.AudioData_doNotDisturb_get(swigCPtr, this); 60 | } 61 | 62 | public void setSource(int value) { 63 | ElkM1APIJNI.AudioData_source_set(swigCPtr, this, value); 64 | } 65 | 66 | public int getSource() { 67 | return ElkM1APIJNI.AudioData_source_get(swigCPtr, this); 68 | } 69 | 70 | public void setVolume(int value) { 71 | ElkM1APIJNI.AudioData_volume_set(swigCPtr, this, value); 72 | } 73 | 74 | public int getVolume() { 75 | return ElkM1APIJNI.AudioData_volume_get(swigCPtr, this); 76 | } 77 | 78 | public void setBass(int value) { 79 | ElkM1APIJNI.AudioData_bass_set(swigCPtr, this, value); 80 | } 81 | 82 | public int getBass() { 83 | return ElkM1APIJNI.AudioData_bass_get(swigCPtr, this); 84 | } 85 | 86 | public void setTreble(int value) { 87 | ElkM1APIJNI.AudioData_treble_set(swigCPtr, this, value); 88 | } 89 | 90 | public int getTreble() { 91 | return ElkM1APIJNI.AudioData_treble_get(swigCPtr, this); 92 | } 93 | 94 | public void setBalance(int value) { 95 | ElkM1APIJNI.AudioData_balance_set(swigCPtr, this, value); 96 | } 97 | 98 | public int getBalance() { 99 | return ElkM1APIJNI.AudioData_balance_get(swigCPtr, this); 100 | } 101 | 102 | public void setPartyMode(AudioData.PartyMode value) { 103 | ElkM1APIJNI.AudioData_partyMode_set(swigCPtr, this, value.swigValue()); 104 | } 105 | 106 | public AudioData.PartyMode getPartyMode() { 107 | return AudioData.PartyMode.swigToEnum(ElkM1APIJNI.AudioData_partyMode_get(swigCPtr, this)); 108 | } 109 | 110 | public AudioData() { 111 | this(ElkM1APIJNI.new_AudioData(), true); 112 | } 113 | 114 | public final static class PartyMode { 115 | public final static AudioData.PartyMode PARTYMODE_OFF = new AudioData.PartyMode("PARTYMODE_OFF"); 116 | public final static AudioData.PartyMode PARTYMODE_ON = new AudioData.PartyMode("PARTYMODE_ON"); 117 | public final static AudioData.PartyMode PARTYMODE_MASTER = new AudioData.PartyMode("PARTYMODE_MASTER"); 118 | 119 | public final int swigValue() { 120 | return swigValue; 121 | } 122 | 123 | public String toString() { 124 | return swigName; 125 | } 126 | 127 | public static PartyMode swigToEnum(int swigValue) { 128 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 129 | return swigValues[swigValue]; 130 | for (int i = 0; i < swigValues.length; i++) 131 | if (swigValues[i].swigValue == swigValue) 132 | return swigValues[i]; 133 | throw new IllegalArgumentException("No enum " + PartyMode.class + " with value " + swigValue); 134 | } 135 | 136 | private PartyMode(String swigName) { 137 | this.swigName = swigName; 138 | this.swigValue = swigNext++; 139 | } 140 | 141 | private PartyMode(String swigName, int swigValue) { 142 | this.swigName = swigName; 143 | this.swigValue = swigValue; 144 | swigNext = swigValue+1; 145 | } 146 | 147 | private PartyMode(String swigName, PartyMode swigEnum) { 148 | this.swigName = swigName; 149 | this.swigValue = swigEnum.swigValue; 150 | swigNext = this.swigValue+1; 151 | } 152 | 153 | private static PartyMode[] swigValues = { PARTYMODE_OFF, PARTYMODE_ON, PARTYMODE_MASTER }; 154 | private static int swigNext = 0; 155 | private final int swigValue; 156 | private final String swigName; 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/BoolCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class BoolCallback { 12 | private transient long swigCPtr; 13 | private transient boolean swigCMemOwn; 14 | 15 | protected BoolCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(BoolCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_BoolCallback(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | ElkM1APIJNI.BoolCallback_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | ElkM1APIJNI.BoolCallback_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public void run(boolean arg1) { 54 | ElkM1APIJNI.BoolCallback_run(swigCPtr, this, arg1); 55 | } 56 | 57 | public BoolCallback() { 58 | this(ElkM1APIJNI.new_BoolCallback(), true); 59 | ElkM1APIJNI.BoolCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/BoolVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class BoolVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected BoolVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(BoolVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_BoolVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public BoolVector() { 39 | this(ElkM1APIJNI.new_BoolVector__SWIG_0(), true); 40 | } 41 | 42 | public BoolVector(long n) { 43 | this(ElkM1APIJNI.new_BoolVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.BoolVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.BoolVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.BoolVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.BoolVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.BoolVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(boolean x) { 67 | ElkM1APIJNI.BoolVector_add(swigCPtr, this, x); 68 | } 69 | 70 | public boolean get(int i) { 71 | return ElkM1APIJNI.BoolVector_get(swigCPtr, this, i); 72 | } 73 | 74 | public void set(int i, boolean val) { 75 | ElkM1APIJNI.BoolVector_set(swigCPtr, this, i, val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/C1M1Tunnel.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class C1M1Tunnel { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected C1M1Tunnel(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(C1M1Tunnel obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_C1M1Tunnel(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | ElkM1APIJNI.C1M1Tunnel_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | ElkM1APIJNI.C1M1Tunnel_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public C1M1Tunnel(M1Connection underlying) { 54 | this(ElkM1APIJNI.new_C1M1Tunnel(M1Connection.getCPtr(underlying), underlying), true); 55 | ElkM1APIJNI.C1M1Tunnel_director_connect(this, swigCPtr, swigCMemOwn, true); 56 | } 57 | 58 | public NetworkType Authenticate(String username, String password, String sernum) { 59 | return NetworkType.swigToEnum(ElkM1APIJNI.C1M1Tunnel_Authenticate(swigCPtr, this, username, password, sernum)); 60 | } 61 | 62 | public boolean Connect(String location, int port) { 63 | return (getClass() == C1M1Tunnel.class) ? ElkM1APIJNI.C1M1Tunnel_Connect(swigCPtr, this, location, port) : ElkM1APIJNI.C1M1Tunnel_ConnectSwigExplicitC1M1Tunnel(swigCPtr, this, location, port); 64 | } 65 | 66 | public void Disconnect() { 67 | if (getClass() == C1M1Tunnel.class) ElkM1APIJNI.C1M1Tunnel_Disconnect(swigCPtr, this); else ElkM1APIJNI.C1M1Tunnel_DisconnectSwigExplicitC1M1Tunnel(swigCPtr, this); 68 | } 69 | 70 | public void Send(CharVector data) { 71 | if (getClass() == C1M1Tunnel.class) ElkM1APIJNI.C1M1Tunnel_Send(swigCPtr, this, CharVector.getCPtr(data), data); else ElkM1APIJNI.C1M1Tunnel_SendSwigExplicitC1M1Tunnel(swigCPtr, this, CharVector.getCPtr(data), data); 72 | } 73 | 74 | public CharVector Recieve() { 75 | return new CharVector((getClass() == C1M1Tunnel.class) ? ElkM1APIJNI.C1M1Tunnel_Recieve(swigCPtr, this) : ElkM1APIJNI.C1M1Tunnel_RecieveSwigExplicitC1M1Tunnel(swigCPtr, this), true); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/CharVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class CharVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected CharVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(CharVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_CharVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public CharVector() { 39 | this(ElkM1APIJNI.new_CharVector__SWIG_0(), true); 40 | } 41 | 42 | public CharVector(long n) { 43 | this(ElkM1APIJNI.new_CharVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.CharVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.CharVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.CharVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.CharVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.CharVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(char x) { 67 | ElkM1APIJNI.CharVector_add(swigCPtr, this, x); 68 | } 69 | 70 | public char get(int i) { 71 | return ElkM1APIJNI.CharVector_get(swigCPtr, this, i); 72 | } 73 | 74 | public void set(int i, char val) { 75 | ElkM1APIJNI.CharVector_set(swigCPtr, this, i, val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ChimeMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class ChimeMode { 12 | public final static ChimeMode CHIMEMODE_OFF = new ChimeMode("CHIMEMODE_OFF"); 13 | public final static ChimeMode CHIMEMODE_CHIMEONLY = new ChimeMode("CHIMEMODE_CHIMEONLY"); 14 | public final static ChimeMode CHIMEMODE_VOICEONLY = new ChimeMode("CHIMEMODE_VOICEONLY"); 15 | public final static ChimeMode CHIMEMODE_BOTH = new ChimeMode("CHIMEMODE_BOTH"); 16 | 17 | public final int swigValue() { 18 | return swigValue; 19 | } 20 | 21 | public String toString() { 22 | return swigName; 23 | } 24 | 25 | public static ChimeMode swigToEnum(int swigValue) { 26 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 27 | return swigValues[swigValue]; 28 | for (int i = 0; i < swigValues.length; i++) 29 | if (swigValues[i].swigValue == swigValue) 30 | return swigValues[i]; 31 | throw new IllegalArgumentException("No enum " + ChimeMode.class + " with value " + swigValue); 32 | } 33 | 34 | private ChimeMode(String swigName) { 35 | this.swigName = swigName; 36 | this.swigValue = swigNext++; 37 | } 38 | 39 | private ChimeMode(String swigName, int swigValue) { 40 | this.swigName = swigName; 41 | this.swigValue = swigValue; 42 | swigNext = swigValue+1; 43 | } 44 | 45 | private ChimeMode(String swigName, ChimeMode swigEnum) { 46 | this.swigName = swigName; 47 | this.swigValue = swigEnum.swigValue; 48 | swigNext = this.swigValue+1; 49 | } 50 | 51 | private static ChimeMode[] swigValues = { CHIMEMODE_OFF, CHIMEMODE_CHIMEONLY, CHIMEMODE_VOICEONLY, CHIMEMODE_BOTH }; 52 | private static int swigNext = 0; 53 | private final int swigValue; 54 | private final String swigName; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ChimeModeVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ChimeModeVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ChimeModeVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ChimeModeVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ChimeModeVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public ChimeModeVector() { 39 | this(ElkM1APIJNI.new_ChimeModeVector__SWIG_0(), true); 40 | } 41 | 42 | public ChimeModeVector(long n) { 43 | this(ElkM1APIJNI.new_ChimeModeVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.ChimeModeVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.ChimeModeVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.ChimeModeVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.ChimeModeVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.ChimeModeVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(SChimeMode x) { 67 | ElkM1APIJNI.ChimeModeVector_add(swigCPtr, this, SChimeMode.getCPtr(x), x); 68 | } 69 | 70 | public SChimeMode get(int i) { 71 | return new SChimeMode(ElkM1APIJNI.ChimeModeVector_get(swigCPtr, this, i), false); 72 | } 73 | 74 | public void set(int i, SChimeMode val) { 75 | ElkM1APIJNI.ChimeModeVector_set(swigCPtr, this, i, SChimeMode.getCPtr(val), val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ElkM1API.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ElkM1API { 12 | } 13 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/FKEY.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class FKEY { 12 | public final static FKEY FKEY_1 = new FKEY("FKEY_1"); 13 | public final static FKEY FKEY_2 = new FKEY("FKEY_2"); 14 | public final static FKEY FKEY_3 = new FKEY("FKEY_3"); 15 | public final static FKEY FKEY_4 = new FKEY("FKEY_4"); 16 | public final static FKEY FKEY_5 = new FKEY("FKEY_5"); 17 | public final static FKEY FKEY_6 = new FKEY("FKEY_6"); 18 | public final static FKEY FKEY_STAR = new FKEY("FKEY_STAR"); 19 | public final static FKEY FKEY_CHIME = new FKEY("FKEY_CHIME"); 20 | public final static FKEY FKEY_NONE = new FKEY("FKEY_NONE"); 21 | 22 | public final int swigValue() { 23 | return swigValue; 24 | } 25 | 26 | public String toString() { 27 | return swigName; 28 | } 29 | 30 | public static FKEY swigToEnum(int swigValue) { 31 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 32 | return swigValues[swigValue]; 33 | for (int i = 0; i < swigValues.length; i++) 34 | if (swigValues[i].swigValue == swigValue) 35 | return swigValues[i]; 36 | throw new IllegalArgumentException("No enum " + FKEY.class + " with value " + swigValue); 37 | } 38 | 39 | private FKEY(String swigName) { 40 | this.swigName = swigName; 41 | this.swigValue = swigNext++; 42 | } 43 | 44 | private FKEY(String swigName, int swigValue) { 45 | this.swigName = swigName; 46 | this.swigValue = swigValue; 47 | swigNext = swigValue+1; 48 | } 49 | 50 | private FKEY(String swigName, FKEY swigEnum) { 51 | this.swigName = swigName; 52 | this.swigValue = swigEnum.swigValue; 53 | swigNext = this.swigValue+1; 54 | } 55 | 56 | private static FKEY[] swigValues = { FKEY_1, FKEY_2, FKEY_3, FKEY_4, FKEY_5, FKEY_6, FKEY_STAR, FKEY_CHIME, FKEY_NONE }; 57 | private static int swigNext = 0; 58 | private final int swigValue; 59 | private final String swigName; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/IntCallback.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class IntCallback { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected IntCallback(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(IntCallback obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_IntCallback(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | ElkM1APIJNI.IntCallback_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | ElkM1APIJNI.IntCallback_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public void run(int arg1) { 54 | ElkM1APIJNI.IntCallback_run(swigCPtr, this, arg1); 55 | } 56 | 57 | public IntCallback() { 58 | this(ElkM1APIJNI.new_IntCallback(), true); 59 | ElkM1APIJNI.IntCallback_director_connect(this, swigCPtr, swigCMemOwn, true); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/IntVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class IntVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected IntVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(IntVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_IntVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public IntVector() { 39 | this(ElkM1APIJNI.new_IntVector__SWIG_0(), true); 40 | } 41 | 42 | public IntVector(long n) { 43 | this(ElkM1APIJNI.new_IntVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.IntVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.IntVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.IntVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.IntVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.IntVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(int x) { 67 | ElkM1APIJNI.IntVector_add(swigCPtr, this, x); 68 | } 69 | 70 | public int get(int i) { 71 | return ElkM1APIJNI.IntVector_get(swigCPtr, this, i); 72 | } 73 | 74 | public void set(int i, int val) { 75 | ElkM1APIJNI.IntVector_set(swigCPtr, this, i, val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/KeypadFkeyStatus.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class KeypadFkeyStatus { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected KeypadFkeyStatus(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(KeypadFkeyStatus obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_KeypadFkeyStatus(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setIllumination(SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination value) { 39 | ElkM1APIJNI.KeypadFkeyStatus_illumination_set(swigCPtr, this, SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination.getCPtr(value)); 40 | } 41 | 42 | public SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination getIllumination() { 43 | long cPtr = ElkM1APIJNI.KeypadFkeyStatus_illumination_get(swigCPtr, this); 44 | return (cPtr == 0) ? null : new SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination(cPtr, false); 45 | } 46 | 47 | public void setCodeRequiredForBypass(boolean value) { 48 | ElkM1APIJNI.KeypadFkeyStatus_codeRequiredForBypass_set(swigCPtr, this, value); 49 | } 50 | 51 | public boolean getCodeRequiredForBypass() { 52 | return ElkM1APIJNI.KeypadFkeyStatus_codeRequiredForBypass_get(swigCPtr, this); 53 | } 54 | 55 | public KeypadFkeyStatus() { 56 | this(ElkM1APIJNI.new_KeypadFkeyStatus(), true); 57 | } 58 | 59 | public final static class FkeyIllumination { 60 | public final static KeypadFkeyStatus.FkeyIllumination FKEY_OFF = new KeypadFkeyStatus.FkeyIllumination("FKEY_OFF"); 61 | public final static KeypadFkeyStatus.FkeyIllumination FKEY_ON = new KeypadFkeyStatus.FkeyIllumination("FKEY_ON"); 62 | public final static KeypadFkeyStatus.FkeyIllumination FKEY_BLINKING = new KeypadFkeyStatus.FkeyIllumination("FKEY_BLINKING"); 63 | 64 | public final int swigValue() { 65 | return swigValue; 66 | } 67 | 68 | public String toString() { 69 | return swigName; 70 | } 71 | 72 | public static FkeyIllumination swigToEnum(int swigValue) { 73 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 74 | return swigValues[swigValue]; 75 | for (int i = 0; i < swigValues.length; i++) 76 | if (swigValues[i].swigValue == swigValue) 77 | return swigValues[i]; 78 | throw new IllegalArgumentException("No enum " + FkeyIllumination.class + " with value " + swigValue); 79 | } 80 | 81 | private FkeyIllumination(String swigName) { 82 | this.swigName = swigName; 83 | this.swigValue = swigNext++; 84 | } 85 | 86 | private FkeyIllumination(String swigName, int swigValue) { 87 | this.swigName = swigName; 88 | this.swigValue = swigValue; 89 | swigNext = swigValue+1; 90 | } 91 | 92 | private FkeyIllumination(String swigName, FkeyIllumination swigEnum) { 93 | this.swigName = swigName; 94 | this.swigValue = swigEnum.swigValue; 95 | swigNext = this.swigValue+1; 96 | } 97 | 98 | private static FkeyIllumination[] swigValues = { FKEY_OFF, FKEY_ON, FKEY_BLINKING }; 99 | private static int swigNext = 0; 100 | private final int swigValue; 101 | private final String swigName; 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/LogEntry.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class LogEntry { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected LogEntry(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(LogEntry obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_LogEntry(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setEvent(int value) { 39 | ElkM1APIJNI.LogEntry_event_set(swigCPtr, this, value); 40 | } 41 | 42 | public int getEvent() { 43 | return ElkM1APIJNI.LogEntry_event_get(swigCPtr, this); 44 | } 45 | 46 | public void setEventSubjectNumber(int value) { 47 | ElkM1APIJNI.LogEntry_eventSubjectNumber_set(swigCPtr, this, value); 48 | } 49 | 50 | public int getEventSubjectNumber() { 51 | return ElkM1APIJNI.LogEntry_eventSubjectNumber_get(swigCPtr, this); 52 | } 53 | 54 | public void setArea(int value) { 55 | ElkM1APIJNI.LogEntry_area_set(swigCPtr, this, value); 56 | } 57 | 58 | public int getArea() { 59 | return ElkM1APIJNI.LogEntry_area_get(swigCPtr, this); 60 | } 61 | 62 | public void setHour(int value) { 63 | ElkM1APIJNI.LogEntry_hour_set(swigCPtr, this, value); 64 | } 65 | 66 | public int getHour() { 67 | return ElkM1APIJNI.LogEntry_hour_get(swigCPtr, this); 68 | } 69 | 70 | public void setMinute(int value) { 71 | ElkM1APIJNI.LogEntry_minute_set(swigCPtr, this, value); 72 | } 73 | 74 | public int getMinute() { 75 | return ElkM1APIJNI.LogEntry_minute_get(swigCPtr, this); 76 | } 77 | 78 | public void setMonth(int value) { 79 | ElkM1APIJNI.LogEntry_month_set(swigCPtr, this, value); 80 | } 81 | 82 | public int getMonth() { 83 | return ElkM1APIJNI.LogEntry_month_get(swigCPtr, this); 84 | } 85 | 86 | public void setDay(int value) { 87 | ElkM1APIJNI.LogEntry_day_set(swigCPtr, this, value); 88 | } 89 | 90 | public int getDay() { 91 | return ElkM1APIJNI.LogEntry_day_get(swigCPtr, this); 92 | } 93 | 94 | public void setIndex(int value) { 95 | ElkM1APIJNI.LogEntry_index_set(swigCPtr, this, value); 96 | } 97 | 98 | public int getIndex() { 99 | return ElkM1APIJNI.LogEntry_index_get(swigCPtr, this); 100 | } 101 | 102 | public void setYear(int value) { 103 | ElkM1APIJNI.LogEntry_year_set(swigCPtr, this, value); 104 | } 105 | 106 | public int getYear() { 107 | return ElkM1APIJNI.LogEntry_year_get(swigCPtr, this); 108 | } 109 | 110 | public void setDayOfWeek(Weekday value) { 111 | ElkM1APIJNI.LogEntry_dayOfWeek_set(swigCPtr, this, value.swigValue()); 112 | } 113 | 114 | public Weekday getDayOfWeek() { 115 | return Weekday.swigToEnum(ElkM1APIJNI.LogEntry_dayOfWeek_get(swigCPtr, this)); 116 | } 117 | 118 | public LogEntry() { 119 | this(ElkM1APIJNI.new_LogEntry(), true); 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/LogEntryVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class LogEntryVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected LogEntryVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(LogEntryVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_LogEntryVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public LogEntryVector() { 39 | this(ElkM1APIJNI.new_LogEntryVector__SWIG_0(), true); 40 | } 41 | 42 | public LogEntryVector(long n) { 43 | this(ElkM1APIJNI.new_LogEntryVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.LogEntryVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.LogEntryVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.LogEntryVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.LogEntryVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.LogEntryVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(LogEntry x) { 67 | ElkM1APIJNI.LogEntryVector_add(swigCPtr, this, LogEntry.getCPtr(x), x); 68 | } 69 | 70 | public LogEntry get(int i) { 71 | return new LogEntry(ElkM1APIJNI.LogEntryVector_get(swigCPtr, this, i), false); 72 | } 73 | 74 | public void set(int i, LogEntry val) { 75 | ElkM1APIJNI.LogEntryVector_set(swigCPtr, this, i, LogEntry.getCPtr(val), val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/LogicalZoneState.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class LogicalZoneState { 12 | public final static LogicalZoneState LZS_NORMAL = new LogicalZoneState("LZS_NORMAL"); 13 | public final static LogicalZoneState LZS_TROUBLE = new LogicalZoneState("LZS_TROUBLE"); 14 | public final static LogicalZoneState LZS_VIOLATED = new LogicalZoneState("LZS_VIOLATED"); 15 | public final static LogicalZoneState LZS_BYPASSED = new LogicalZoneState("LZS_BYPASSED"); 16 | 17 | public final int swigValue() { 18 | return swigValue; 19 | } 20 | 21 | public String toString() { 22 | return swigName; 23 | } 24 | 25 | public static LogicalZoneState swigToEnum(int swigValue) { 26 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 27 | return swigValues[swigValue]; 28 | for (int i = 0; i < swigValues.length; i++) 29 | if (swigValues[i].swigValue == swigValue) 30 | return swigValues[i]; 31 | throw new IllegalArgumentException("No enum " + LogicalZoneState.class + " with value " + swigValue); 32 | } 33 | 34 | private LogicalZoneState(String swigName) { 35 | this.swigName = swigName; 36 | this.swigValue = swigNext++; 37 | } 38 | 39 | private LogicalZoneState(String swigName, int swigValue) { 40 | this.swigName = swigName; 41 | this.swigValue = swigValue; 42 | swigNext = swigValue+1; 43 | } 44 | 45 | private LogicalZoneState(String swigName, LogicalZoneState swigEnum) { 46 | this.swigName = swigName; 47 | this.swigValue = swigEnum.swigValue; 48 | swigNext = this.swigValue+1; 49 | } 50 | 51 | private static LogicalZoneState[] swigValues = { LZS_NORMAL, LZS_TROUBLE, LZS_VIOLATED, LZS_BYPASSED }; 52 | private static int swigNext = 0; 53 | private final int swigValue; 54 | private final String swigName; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/M1AsciiAPI.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class M1AsciiAPI extends M1Monitor { 12 | private transient long swigCPtr; 13 | 14 | protected M1AsciiAPI(long cPtr, boolean cMemoryOwn) { 15 | super(ElkM1APIJNI.M1AsciiAPI_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(M1AsciiAPI obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | ElkM1APIJNI.delete_M1AsciiAPI(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public M1AsciiAPI(M1Connection conn) { 39 | this(ElkM1APIJNI.new_M1AsciiAPI(M1Connection.getCPtr(conn), conn), true); 40 | } 41 | 42 | public void collectNames(TextDescriptionType type) { 43 | ElkM1APIJNI.M1AsciiAPI_collectNames(swigCPtr, this, type.swigValue()); 44 | } 45 | 46 | public IntVector getConfiguredAreas() { 47 | return new IntVector(ElkM1APIJNI.M1AsciiAPI_getConfiguredAreas(swigCPtr, this), true); 48 | } 49 | 50 | public void displayLCDText(int area, clearMethod clear, boolean beepKeypad, int displayTime, String text) { 51 | ElkM1APIJNI.M1AsciiAPI_displayLCDText__SWIG_0(swigCPtr, this, area, clear.swigValue(), beepKeypad, displayTime, text); 52 | } 53 | 54 | public void displayLCDText(int area, clearMethod clear, boolean beepKeypad, int displayTime, String lineOne, String lineTwo) { 55 | ElkM1APIJNI.M1AsciiAPI_displayLCDText__SWIG_1(swigCPtr, this, area, clear.swigValue(), beepKeypad, displayTime, lineOne, lineTwo); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/M1Connection.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class M1Connection { 12 | private transient long swigCPtr; 13 | private transient boolean swigCMemOwn; 14 | 15 | protected M1Connection(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(M1Connection obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_M1Connection(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | protected void swigDirectorDisconnect() { 39 | swigCMemOwn = false; 40 | delete(); 41 | } 42 | 43 | public void swigReleaseOwnership() { 44 | swigCMemOwn = false; 45 | ElkM1APIJNI.M1Connection_change_ownership(this, swigCPtr, false); 46 | } 47 | 48 | public void swigTakeOwnership() { 49 | swigCMemOwn = true; 50 | ElkM1APIJNI.M1Connection_change_ownership(this, swigCPtr, true); 51 | } 52 | 53 | public boolean Connect(String location, int port) { 54 | return ElkM1APIJNI.M1Connection_Connect(swigCPtr, this, location, port); 55 | } 56 | 57 | public void Disconnect() { 58 | ElkM1APIJNI.M1Connection_Disconnect(swigCPtr, this); 59 | } 60 | 61 | public void Send(CharVector data) { 62 | ElkM1APIJNI.M1Connection_Send(swigCPtr, this, CharVector.getCPtr(data), data); 63 | } 64 | 65 | public CharVector Recieve() { 66 | return new CharVector(ElkM1APIJNI.M1Connection_Recieve(swigCPtr, this), true); 67 | } 68 | 69 | public M1Connection() { 70 | this(ElkM1APIJNI.new_M1Connection(), true); 71 | ElkM1APIJNI.M1Connection_director_connect(this, swigCPtr, swigCMemOwn, true); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/M1Monitor.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class M1Monitor extends M1API { 12 | private transient long swigCPtr; 13 | 14 | protected M1Monitor(long cPtr, boolean cMemoryOwn) { 15 | super(ElkM1APIJNI.M1Monitor_SWIGUpcast(cPtr), cMemoryOwn); 16 | swigCPtr = cPtr; 17 | } 18 | 19 | protected static long getCPtr(M1Monitor obj) { 20 | return (obj == null) ? 0 : obj.swigCPtr; 21 | } 22 | 23 | protected void finalize() { 24 | delete(); 25 | } 26 | 27 | public synchronized void delete() { 28 | if (swigCPtr != 0) { 29 | if (swigCMemOwn) { 30 | swigCMemOwn = false; 31 | ElkM1APIJNI.delete_M1Monitor(swigCPtr); 32 | } 33 | swigCPtr = 0; 34 | } 35 | super.delete(); 36 | } 37 | 38 | public void run() { 39 | ElkM1APIJNI.M1Monitor_run(swigCPtr, this); 40 | } 41 | 42 | public void stop() { 43 | ElkM1APIJNI.M1Monitor_stop(swigCPtr, this); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/NetworkType.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class NetworkType { 12 | public final static NetworkType NETWORKTYPE_NONE = new NetworkType("NETWORKTYPE_NONE", ElkM1APIJNI.NETWORKTYPE_NONE_get()); 13 | public final static NetworkType NETWORKTYPE_ETHERNET = new NetworkType("NETWORKTYPE_ETHERNET", ElkM1APIJNI.NETWORKTYPE_ETHERNET_get()); 14 | public final static NetworkType NETWORKTYPE_CELLULAR = new NetworkType("NETWORKTYPE_CELLULAR", ElkM1APIJNI.NETWORKTYPE_CELLULAR_get()); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static NetworkType swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + NetworkType.class + " with value " + swigValue); 31 | } 32 | 33 | private NetworkType(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private NetworkType(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private NetworkType(String swigName, NetworkType swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static NetworkType[] swigValues = { NETWORKTYPE_NONE, NETWORKTYPE_ETHERNET, NETWORKTYPE_CELLULAR }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/PhysicalZoneState.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class PhysicalZoneState { 12 | public final static PhysicalZoneState PZS_UNCONFIGURED = new PhysicalZoneState("PZS_UNCONFIGURED"); 13 | public final static PhysicalZoneState PZS_OPEN = new PhysicalZoneState("PZS_OPEN"); 14 | public final static PhysicalZoneState PZS_EOL = new PhysicalZoneState("PZS_EOL"); 15 | public final static PhysicalZoneState PZS_SHORT = new PhysicalZoneState("PZS_SHORT"); 16 | 17 | public final int swigValue() { 18 | return swigValue; 19 | } 20 | 21 | public String toString() { 22 | return swigName; 23 | } 24 | 25 | public static PhysicalZoneState swigToEnum(int swigValue) { 26 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 27 | return swigValues[swigValue]; 28 | for (int i = 0; i < swigValues.length; i++) 29 | if (swigValues[i].swigValue == swigValue) 30 | return swigValues[i]; 31 | throw new IllegalArgumentException("No enum " + PhysicalZoneState.class + " with value " + swigValue); 32 | } 33 | 34 | private PhysicalZoneState(String swigName) { 35 | this.swigName = swigName; 36 | this.swigValue = swigNext++; 37 | } 38 | 39 | private PhysicalZoneState(String swigName, int swigValue) { 40 | this.swigName = swigName; 41 | this.swigValue = swigValue; 42 | swigNext = swigValue+1; 43 | } 44 | 45 | private PhysicalZoneState(String swigName, PhysicalZoneState swigEnum) { 46 | this.swigName = swigName; 47 | this.swigValue = swigEnum.swigValue; 48 | swigNext = this.swigValue+1; 49 | } 50 | 51 | private static PhysicalZoneState[] swigValues = { PZS_UNCONFIGURED, PZS_OPEN, PZS_EOL, PZS_SHORT }; 52 | private static int swigNext = 0; 53 | private final int swigValue; 54 | private final String swigName; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/RTCData.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class RTCData { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected RTCData(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(RTCData obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_RTCData(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setSeconds(int value) { 39 | ElkM1APIJNI.RTCData_seconds_set(swigCPtr, this, value); 40 | } 41 | 42 | public int getSeconds() { 43 | return ElkM1APIJNI.RTCData_seconds_get(swigCPtr, this); 44 | } 45 | 46 | public void setMinutes(int value) { 47 | ElkM1APIJNI.RTCData_minutes_set(swigCPtr, this, value); 48 | } 49 | 50 | public int getMinutes() { 51 | return ElkM1APIJNI.RTCData_minutes_get(swigCPtr, this); 52 | } 53 | 54 | public void setHours(int value) { 55 | ElkM1APIJNI.RTCData_hours_set(swigCPtr, this, value); 56 | } 57 | 58 | public int getHours() { 59 | return ElkM1APIJNI.RTCData_hours_get(swigCPtr, this); 60 | } 61 | 62 | public void setWeekday(Weekday value) { 63 | ElkM1APIJNI.RTCData_weekday_set(swigCPtr, this, value.swigValue()); 64 | } 65 | 66 | public Weekday getWeekday() { 67 | return Weekday.swigToEnum(ElkM1APIJNI.RTCData_weekday_get(swigCPtr, this)); 68 | } 69 | 70 | public void setDay(int value) { 71 | ElkM1APIJNI.RTCData_day_set(swigCPtr, this, value); 72 | } 73 | 74 | public int getDay() { 75 | return ElkM1APIJNI.RTCData_day_get(swigCPtr, this); 76 | } 77 | 78 | public void setMonth(int value) { 79 | ElkM1APIJNI.RTCData_month_set(swigCPtr, this, value); 80 | } 81 | 82 | public int getMonth() { 83 | return ElkM1APIJNI.RTCData_month_get(swigCPtr, this); 84 | } 85 | 86 | public void setYear(int value) { 87 | ElkM1APIJNI.RTCData_year_set(swigCPtr, this, value); 88 | } 89 | 90 | public int getYear() { 91 | return ElkM1APIJNI.RTCData_year_get(swigCPtr, this); 92 | } 93 | 94 | public void setTwelveHourClock(boolean value) { 95 | ElkM1APIJNI.RTCData_twelveHourClock_set(swigCPtr, this, value); 96 | } 97 | 98 | public boolean getTwelveHourClock() { 99 | return ElkM1APIJNI.RTCData_twelveHourClock_get(swigCPtr, this); 100 | } 101 | 102 | public void setDayBeforeMonth(boolean value) { 103 | ElkM1APIJNI.RTCData_dayBeforeMonth_set(swigCPtr, this, value); 104 | } 105 | 106 | public boolean getDayBeforeMonth() { 107 | return ElkM1APIJNI.RTCData_dayBeforeMonth_get(swigCPtr, this); 108 | } 109 | 110 | public RTCData() { 111 | this(ElkM1APIJNI.new_RTCData(), true); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/SChimeMode.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class SChimeMode { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected SChimeMode(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(SChimeMode obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_SChimeMode(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setCm(ChimeMode value) { 39 | ElkM1APIJNI.SChimeMode_cm_set(swigCPtr, this, value.swigValue()); 40 | } 41 | 42 | public ChimeMode getCm() { 43 | return ChimeMode.swigToEnum(ElkM1APIJNI.SChimeMode_cm_get(swigCPtr, this)); 44 | } 45 | 46 | public SChimeMode() { 47 | this(ElkM1APIJNI.new_SChimeMode(), true); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination { 12 | private transient long swigCPtr; 13 | 14 | protected SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination(long cPtr, @SuppressWarnings("unused") boolean futureUse) { 15 | swigCPtr = cPtr; 16 | } 17 | 18 | protected SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination() { 19 | swigCPtr = 0; 20 | } 21 | 22 | protected static long getCPtr(SWIGTYPE_p_Elk__KeypadFkeyStatus__FkeyIllumination obj) { 23 | return (obj == null) ? 0 : obj.swigCPtr; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/SZoneDefinition.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class SZoneDefinition { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected SZoneDefinition(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(SZoneDefinition obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_SZoneDefinition(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setZd(ZoneDefinition value) { 39 | ElkM1APIJNI.SZoneDefinition_zd_set(swigCPtr, this, value.swigValue()); 40 | } 41 | 42 | public ZoneDefinition getZd() { 43 | return ZoneDefinition.swigToEnum(ElkM1APIJNI.SZoneDefinition_zd_get(swigCPtr, this)); 44 | } 45 | 46 | public SZoneDefinition() { 47 | this(ElkM1APIJNI.new_SZoneDefinition(), true); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/SystemTroubleStatus.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class SystemTroubleStatus { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected SystemTroubleStatus(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(SystemTroubleStatus obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_SystemTroubleStatus(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setACFail(boolean value) { 39 | ElkM1APIJNI.SystemTroubleStatus_ACFail_set(swigCPtr, this, value); 40 | } 41 | 42 | public boolean getACFail() { 43 | return ElkM1APIJNI.SystemTroubleStatus_ACFail_get(swigCPtr, this); 44 | } 45 | 46 | public void setBoxTamper(boolean value) { 47 | ElkM1APIJNI.SystemTroubleStatus_boxTamper_set(swigCPtr, this, value); 48 | } 49 | 50 | public boolean getBoxTamper() { 51 | return ElkM1APIJNI.SystemTroubleStatus_boxTamper_get(swigCPtr, this); 52 | } 53 | 54 | public void setCommunicationError(boolean value) { 55 | ElkM1APIJNI.SystemTroubleStatus_communicationError_set(swigCPtr, this, value); 56 | } 57 | 58 | public boolean getCommunicationError() { 59 | return ElkM1APIJNI.SystemTroubleStatus_communicationError_get(swigCPtr, this); 60 | } 61 | 62 | public void setEEPROMError(boolean value) { 63 | ElkM1APIJNI.SystemTroubleStatus_EEPROMError_set(swigCPtr, this, value); 64 | } 65 | 66 | public boolean getEEPROMError() { 67 | return ElkM1APIJNI.SystemTroubleStatus_EEPROMError_get(swigCPtr, this); 68 | } 69 | 70 | public void setLowBattery(boolean value) { 71 | ElkM1APIJNI.SystemTroubleStatus_lowBattery_set(swigCPtr, this, value); 72 | } 73 | 74 | public boolean getLowBattery() { 75 | return ElkM1APIJNI.SystemTroubleStatus_lowBattery_get(swigCPtr, this); 76 | } 77 | 78 | public void setOverCurrent(boolean value) { 79 | ElkM1APIJNI.SystemTroubleStatus_overCurrent_set(swigCPtr, this, value); 80 | } 81 | 82 | public boolean getOverCurrent() { 83 | return ElkM1APIJNI.SystemTroubleStatus_overCurrent_get(swigCPtr, this); 84 | } 85 | 86 | public void setTelephoneFault(boolean value) { 87 | ElkM1APIJNI.SystemTroubleStatus_telephoneFault_set(swigCPtr, this, value); 88 | } 89 | 90 | public boolean getTelephoneFault() { 91 | return ElkM1APIJNI.SystemTroubleStatus_telephoneFault_get(swigCPtr, this); 92 | } 93 | 94 | public void setOutput2(boolean value) { 95 | ElkM1APIJNI.SystemTroubleStatus_output2_set(swigCPtr, this, value); 96 | } 97 | 98 | public boolean getOutput2() { 99 | return ElkM1APIJNI.SystemTroubleStatus_output2_get(swigCPtr, this); 100 | } 101 | 102 | public void setMissingKeypad(boolean value) { 103 | ElkM1APIJNI.SystemTroubleStatus_missingKeypad_set(swigCPtr, this, value); 104 | } 105 | 106 | public boolean getMissingKeypad() { 107 | return ElkM1APIJNI.SystemTroubleStatus_missingKeypad_get(swigCPtr, this); 108 | } 109 | 110 | public void setZoneExpander(boolean value) { 111 | ElkM1APIJNI.SystemTroubleStatus_zoneExpander_set(swigCPtr, this, value); 112 | } 113 | 114 | public boolean getZoneExpander() { 115 | return ElkM1APIJNI.SystemTroubleStatus_zoneExpander_get(swigCPtr, this); 116 | } 117 | 118 | public void setOutputExpander(boolean value) { 119 | ElkM1APIJNI.SystemTroubleStatus_outputExpander_set(swigCPtr, this, value); 120 | } 121 | 122 | public boolean getOutputExpander() { 123 | return ElkM1APIJNI.SystemTroubleStatus_outputExpander_get(swigCPtr, this); 124 | } 125 | 126 | public void setRPRemoteAccess(boolean value) { 127 | ElkM1APIJNI.SystemTroubleStatus_RPRemoteAccess_set(swigCPtr, this, value); 128 | } 129 | 130 | public boolean getRPRemoteAccess() { 131 | return ElkM1APIJNI.SystemTroubleStatus_RPRemoteAccess_get(swigCPtr, this); 132 | } 133 | 134 | public void setCommonAreaNotArmed(boolean value) { 135 | ElkM1APIJNI.SystemTroubleStatus_commonAreaNotArmed_set(swigCPtr, this, value); 136 | } 137 | 138 | public boolean getCommonAreaNotArmed() { 139 | return ElkM1APIJNI.SystemTroubleStatus_commonAreaNotArmed_get(swigCPtr, this); 140 | } 141 | 142 | public void setFlashMemoryError(boolean value) { 143 | ElkM1APIJNI.SystemTroubleStatus_flashMemoryError_set(swigCPtr, this, value); 144 | } 145 | 146 | public boolean getFlashMemoryError() { 147 | return ElkM1APIJNI.SystemTroubleStatus_flashMemoryError_get(swigCPtr, this); 148 | } 149 | 150 | public void setSecurityAlert(boolean value) { 151 | ElkM1APIJNI.SystemTroubleStatus_securityAlert_set(swigCPtr, this, value); 152 | } 153 | 154 | public boolean getSecurityAlert() { 155 | return ElkM1APIJNI.SystemTroubleStatus_securityAlert_get(swigCPtr, this); 156 | } 157 | 158 | public void setSerialPortExpander(boolean value) { 159 | ElkM1APIJNI.SystemTroubleStatus_serialPortExpander_set(swigCPtr, this, value); 160 | } 161 | 162 | public boolean getSerialPortExpander() { 163 | return ElkM1APIJNI.SystemTroubleStatus_serialPortExpander_get(swigCPtr, this); 164 | } 165 | 166 | public void setLostTransmitter(boolean value) { 167 | ElkM1APIJNI.SystemTroubleStatus_lostTransmitter_set(swigCPtr, this, value); 168 | } 169 | 170 | public boolean getLostTransmitter() { 171 | return ElkM1APIJNI.SystemTroubleStatus_lostTransmitter_get(swigCPtr, this); 172 | } 173 | 174 | public void setGESmokeCleanMe(boolean value) { 175 | ElkM1APIJNI.SystemTroubleStatus_GESmokeCleanMe_set(swigCPtr, this, value); 176 | } 177 | 178 | public boolean getGESmokeCleanMe() { 179 | return ElkM1APIJNI.SystemTroubleStatus_GESmokeCleanMe_get(swigCPtr, this); 180 | } 181 | 182 | public void setEthernet(boolean value) { 183 | ElkM1APIJNI.SystemTroubleStatus_ethernet_set(swigCPtr, this, value); 184 | } 185 | 186 | public boolean getEthernet() { 187 | return ElkM1APIJNI.SystemTroubleStatus_ethernet_get(swigCPtr, this); 188 | } 189 | 190 | public SystemTroubleStatus() { 191 | this(ElkM1APIJNI.new_SystemTroubleStatus(), true); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/TempDevicePair.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class TempDevicePair { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected TempDevicePair(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(TempDevicePair obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_TempDevicePair(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public TempDevicePair() { 39 | this(ElkM1APIJNI.new_TempDevicePair__SWIG_0(), true); 40 | } 41 | 42 | public TempDevicePair(int first, TemperatureDevice second) { 43 | this(ElkM1APIJNI.new_TempDevicePair__SWIG_1(first, second.swigValue()), true); 44 | } 45 | 46 | public TempDevicePair(TempDevicePair p) { 47 | this(ElkM1APIJNI.new_TempDevicePair__SWIG_2(TempDevicePair.getCPtr(p), p), true); 48 | } 49 | 50 | public void setFirst(int value) { 51 | ElkM1APIJNI.TempDevicePair_first_set(swigCPtr, this, value); 52 | } 53 | 54 | public int getFirst() { 55 | return ElkM1APIJNI.TempDevicePair_first_get(swigCPtr, this); 56 | } 57 | 58 | public void setSecond(TemperatureDevice value) { 59 | ElkM1APIJNI.TempDevicePair_second_set(swigCPtr, this, value.swigValue()); 60 | } 61 | 62 | public TemperatureDevice getSecond() { 63 | return TemperatureDevice.swigToEnum(ElkM1APIJNI.TempDevicePair_second_get(swigCPtr, this)); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/TempDevicePairVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class TempDevicePairVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected TempDevicePairVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(TempDevicePairVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_TempDevicePairVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public TempDevicePairVector() { 39 | this(ElkM1APIJNI.new_TempDevicePairVector__SWIG_0(), true); 40 | } 41 | 42 | public TempDevicePairVector(long n) { 43 | this(ElkM1APIJNI.new_TempDevicePairVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.TempDevicePairVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.TempDevicePairVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.TempDevicePairVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.TempDevicePairVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.TempDevicePairVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(TempDevicePair x) { 67 | ElkM1APIJNI.TempDevicePairVector_add(swigCPtr, this, TempDevicePair.getCPtr(x), x); 68 | } 69 | 70 | public TempDevicePair get(int i) { 71 | return new TempDevicePair(ElkM1APIJNI.TempDevicePairVector_get(swigCPtr, this, i), false); 72 | } 73 | 74 | public void set(int i, TempDevicePair val) { 75 | ElkM1APIJNI.TempDevicePairVector_set(swigCPtr, this, i, TempDevicePair.getCPtr(val), val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/TemperatureDevice.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class TemperatureDevice { 12 | public final static TemperatureDevice TEMPDEVICE_ZONE = new TemperatureDevice("TEMPDEVICE_ZONE", ElkM1APIJNI.TEMPDEVICE_ZONE_get()); 13 | public final static TemperatureDevice TEMPDEVICE_KEYPAD = new TemperatureDevice("TEMPDEVICE_KEYPAD", ElkM1APIJNI.TEMPDEVICE_KEYPAD_get()); 14 | public final static TemperatureDevice TEMPDEVICE_THERMOSTAT = new TemperatureDevice("TEMPDEVICE_THERMOSTAT", ElkM1APIJNI.TEMPDEVICE_THERMOSTAT_get()); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static TemperatureDevice swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + TemperatureDevice.class + " with value " + swigValue); 31 | } 32 | 33 | private TemperatureDevice(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private TemperatureDevice(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private TemperatureDevice(String swigName, TemperatureDevice swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static TemperatureDevice[] swigValues = { TEMPDEVICE_ZONE, TEMPDEVICE_KEYPAD, TEMPDEVICE_THERMOSTAT }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/TextDescriptionType.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class TextDescriptionType { 12 | public final static TextDescriptionType TEXT_ZoneName = new TextDescriptionType("TEXT_ZoneName"); 13 | public final static TextDescriptionType TEXT_AreaName = new TextDescriptionType("TEXT_AreaName"); 14 | public final static TextDescriptionType TEXT_UserName = new TextDescriptionType("TEXT_UserName"); 15 | public final static TextDescriptionType TEXT_KeypadName = new TextDescriptionType("TEXT_KeypadName"); 16 | public final static TextDescriptionType TEXT_OutputName = new TextDescriptionType("TEXT_OutputName"); 17 | public final static TextDescriptionType TEXT_TaskName = new TextDescriptionType("TEXT_TaskName"); 18 | public final static TextDescriptionType TEXT_TelephoneName = new TextDescriptionType("TEXT_TelephoneName"); 19 | public final static TextDescriptionType TEXT_LightName = new TextDescriptionType("TEXT_LightName"); 20 | public final static TextDescriptionType TEXT_AlarmDurationName = new TextDescriptionType("TEXT_AlarmDurationName"); 21 | public final static TextDescriptionType TEXT_CustomSettings = new TextDescriptionType("TEXT_CustomSettings"); 22 | public final static TextDescriptionType TEXT_CounterName = new TextDescriptionType("TEXT_CounterName"); 23 | public final static TextDescriptionType TEXT_ThermostatName = new TextDescriptionType("TEXT_ThermostatName"); 24 | public final static TextDescriptionType TEXT_FKEY1 = new TextDescriptionType("TEXT_FKEY1"); 25 | public final static TextDescriptionType TEXT_FKEY2 = new TextDescriptionType("TEXT_FKEY2"); 26 | public final static TextDescriptionType TEXT_FKEY3 = new TextDescriptionType("TEXT_FKEY3"); 27 | public final static TextDescriptionType TEXT_FKEY4 = new TextDescriptionType("TEXT_FKEY4"); 28 | public final static TextDescriptionType TEXT_FKEY5 = new TextDescriptionType("TEXT_FKEY5"); 29 | public final static TextDescriptionType TEXT_FKEY6 = new TextDescriptionType("TEXT_FKEY6"); 30 | public final static TextDescriptionType TEXT_AudioZoneName = new TextDescriptionType("TEXT_AudioZoneName"); 31 | public final static TextDescriptionType TEXT_AudioSourceName = new TextDescriptionType("TEXT_AudioSourceName"); 32 | 33 | public final int swigValue() { 34 | return swigValue; 35 | } 36 | 37 | public String toString() { 38 | return swigName; 39 | } 40 | 41 | public static TextDescriptionType swigToEnum(int swigValue) { 42 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 43 | return swigValues[swigValue]; 44 | for (int i = 0; i < swigValues.length; i++) 45 | if (swigValues[i].swigValue == swigValue) 46 | return swigValues[i]; 47 | throw new IllegalArgumentException("No enum " + TextDescriptionType.class + " with value " + swigValue); 48 | } 49 | 50 | private TextDescriptionType(String swigName) { 51 | this.swigName = swigName; 52 | this.swigValue = swigNext++; 53 | } 54 | 55 | private TextDescriptionType(String swigName, int swigValue) { 56 | this.swigName = swigName; 57 | this.swigValue = swigValue; 58 | swigNext = swigValue+1; 59 | } 60 | 61 | private TextDescriptionType(String swigName, TextDescriptionType swigEnum) { 62 | this.swigName = swigName; 63 | this.swigValue = swigEnum.swigValue; 64 | swigNext = this.swigValue+1; 65 | } 66 | 67 | private static TextDescriptionType[] swigValues = { TEXT_ZoneName, TEXT_AreaName, TEXT_UserName, TEXT_KeypadName, TEXT_OutputName, TEXT_TaskName, TEXT_TelephoneName, TEXT_LightName, TEXT_AlarmDurationName, TEXT_CustomSettings, TEXT_CounterName, TEXT_ThermostatName, TEXT_FKEY1, TEXT_FKEY2, TEXT_FKEY3, TEXT_FKEY4, TEXT_FKEY5, TEXT_FKEY6, TEXT_AudioZoneName, TEXT_AudioSourceName }; 68 | private static int swigNext = 0; 69 | private final int swigValue; 70 | private final String swigName; 71 | } 72 | 73 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ThermostatData.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ThermostatData { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ThermostatData(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ThermostatData obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ThermostatData(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setMode(ThermostatData.ThermostatMode value) { 39 | ElkM1APIJNI.ThermostatData_mode_set(swigCPtr, this, value.swigValue()); 40 | } 41 | 42 | public ThermostatData.ThermostatMode getMode() { 43 | return ThermostatData.ThermostatMode.swigToEnum(ElkM1APIJNI.ThermostatData_mode_get(swigCPtr, this)); 44 | } 45 | 46 | public void setHoldCurrentTemperature(boolean value) { 47 | ElkM1APIJNI.ThermostatData_holdCurrentTemperature_set(swigCPtr, this, value); 48 | } 49 | 50 | public boolean getHoldCurrentTemperature() { 51 | return ElkM1APIJNI.ThermostatData_holdCurrentTemperature_get(swigCPtr, this); 52 | } 53 | 54 | public void setFanOn(boolean value) { 55 | ElkM1APIJNI.ThermostatData_fanOn_set(swigCPtr, this, value); 56 | } 57 | 58 | public boolean getFanOn() { 59 | return ElkM1APIJNI.ThermostatData_fanOn_get(swigCPtr, this); 60 | } 61 | 62 | public void setTemperature(int value) { 63 | ElkM1APIJNI.ThermostatData_temperature_set(swigCPtr, this, value); 64 | } 65 | 66 | public int getTemperature() { 67 | return ElkM1APIJNI.ThermostatData_temperature_get(swigCPtr, this); 68 | } 69 | 70 | public void setHeatSetPoint(int value) { 71 | ElkM1APIJNI.ThermostatData_heatSetPoint_set(swigCPtr, this, value); 72 | } 73 | 74 | public int getHeatSetPoint() { 75 | return ElkM1APIJNI.ThermostatData_heatSetPoint_get(swigCPtr, this); 76 | } 77 | 78 | public void setCoolSetPoint(int value) { 79 | ElkM1APIJNI.ThermostatData_coolSetPoint_set(swigCPtr, this, value); 80 | } 81 | 82 | public int getCoolSetPoint() { 83 | return ElkM1APIJNI.ThermostatData_coolSetPoint_get(swigCPtr, this); 84 | } 85 | 86 | public void setHumidity(int value) { 87 | ElkM1APIJNI.ThermostatData_humidity_set(swigCPtr, this, value); 88 | } 89 | 90 | public int getHumidity() { 91 | return ElkM1APIJNI.ThermostatData_humidity_get(swigCPtr, this); 92 | } 93 | 94 | public ThermostatData() { 95 | this(ElkM1APIJNI.new_ThermostatData(), true); 96 | } 97 | 98 | public final static class ThermostatMode { 99 | public final static ThermostatData.ThermostatMode OFF = new ThermostatData.ThermostatMode("OFF"); 100 | public final static ThermostatData.ThermostatMode HEAT = new ThermostatData.ThermostatMode("HEAT"); 101 | public final static ThermostatData.ThermostatMode COOL = new ThermostatData.ThermostatMode("COOL"); 102 | public final static ThermostatData.ThermostatMode AUTO = new ThermostatData.ThermostatMode("AUTO"); 103 | public final static ThermostatData.ThermostatMode EMERGENCY_HEAT = new ThermostatData.ThermostatMode("EMERGENCY_HEAT"); 104 | 105 | public final int swigValue() { 106 | return swigValue; 107 | } 108 | 109 | public String toString() { 110 | return swigName; 111 | } 112 | 113 | public static ThermostatMode swigToEnum(int swigValue) { 114 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 115 | return swigValues[swigValue]; 116 | for (int i = 0; i < swigValues.length; i++) 117 | if (swigValues[i].swigValue == swigValue) 118 | return swigValues[i]; 119 | throw new IllegalArgumentException("No enum " + ThermostatMode.class + " with value " + swigValue); 120 | } 121 | 122 | private ThermostatMode(String swigName) { 123 | this.swigName = swigName; 124 | this.swigValue = swigNext++; 125 | } 126 | 127 | private ThermostatMode(String swigName, int swigValue) { 128 | this.swigName = swigName; 129 | this.swigValue = swigValue; 130 | swigNext = swigValue+1; 131 | } 132 | 133 | private ThermostatMode(String swigName, ThermostatMode swigEnum) { 134 | this.swigName = swigName; 135 | this.swigValue = swigEnum.swigValue; 136 | swigNext = this.swigValue+1; 137 | } 138 | 139 | private static ThermostatMode[] swigValues = { OFF, HEAT, COOL, AUTO, EMERGENCY_HEAT }; 140 | private static int swigNext = 0; 141 | private final int swigValue; 142 | private final String swigName; 143 | } 144 | 145 | } 146 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/UShortVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class UShortVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected UShortVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(UShortVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_UShortVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public UShortVector() { 39 | this(ElkM1APIJNI.new_UShortVector__SWIG_0(), true); 40 | } 41 | 42 | public UShortVector(long n) { 43 | this(ElkM1APIJNI.new_UShortVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.UShortVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.UShortVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.UShortVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.UShortVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.UShortVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(int x) { 67 | ElkM1APIJNI.UShortVector_add(swigCPtr, this, x); 68 | } 69 | 70 | public int get(int i) { 71 | return ElkM1APIJNI.UShortVector_get(swigCPtr, this, i); 72 | } 73 | 74 | public void set(int i, int val) { 75 | ElkM1APIJNI.UShortVector_set(swigCPtr, this, i, val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/UserCodeAccess.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class UserCodeAccess { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected UserCodeAccess(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(UserCodeAccess obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_UserCodeAccess(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setCodetype(UserCodeAccess.CodeType value) { 39 | ElkM1APIJNI.UserCodeAccess_codetype_set(swigCPtr, this, value.swigValue()); 40 | } 41 | 42 | public UserCodeAccess.CodeType getCodetype() { 43 | return UserCodeAccess.CodeType.swigToEnum(ElkM1APIJNI.UserCodeAccess_codetype_get(swigCPtr, this)); 44 | } 45 | 46 | public void setUsesCelcius(boolean value) { 47 | ElkM1APIJNI.UserCodeAccess_usesCelcius_set(swigCPtr, this, value); 48 | } 49 | 50 | public boolean getUsesCelcius() { 51 | return ElkM1APIJNI.UserCodeAccess_usesCelcius_get(swigCPtr, this); 52 | } 53 | 54 | public void setValidAreas(short value) { 55 | ElkM1APIJNI.UserCodeAccess_validAreas_set(swigCPtr, this, value); 56 | } 57 | 58 | public short getValidAreas() { 59 | return ElkM1APIJNI.UserCodeAccess_validAreas_get(swigCPtr, this); 60 | } 61 | 62 | public UserCodeAccess() { 63 | this(ElkM1APIJNI.new_UserCodeAccess(), true); 64 | } 65 | 66 | public final static class CodeType { 67 | public final static UserCodeAccess.CodeType CODETYPE_USER = new UserCodeAccess.CodeType("CODETYPE_USER", ElkM1APIJNI.UserCodeAccess_CODETYPE_USER_get()); 68 | public final static UserCodeAccess.CodeType CODETYPE_MASTER = new UserCodeAccess.CodeType("CODETYPE_MASTER"); 69 | public final static UserCodeAccess.CodeType CODETYPE_INSTALLER = new UserCodeAccess.CodeType("CODETYPE_INSTALLER"); 70 | public final static UserCodeAccess.CodeType CODETYPE_ELKRP = new UserCodeAccess.CodeType("CODETYPE_ELKRP"); 71 | 72 | public final int swigValue() { 73 | return swigValue; 74 | } 75 | 76 | public String toString() { 77 | return swigName; 78 | } 79 | 80 | public static CodeType swigToEnum(int swigValue) { 81 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 82 | return swigValues[swigValue]; 83 | for (int i = 0; i < swigValues.length; i++) 84 | if (swigValues[i].swigValue == swigValue) 85 | return swigValues[i]; 86 | throw new IllegalArgumentException("No enum " + CodeType.class + " with value " + swigValue); 87 | } 88 | 89 | private CodeType(String swigName) { 90 | this.swigName = swigName; 91 | this.swigValue = swigNext++; 92 | } 93 | 94 | private CodeType(String swigName, int swigValue) { 95 | this.swigName = swigName; 96 | this.swigValue = swigValue; 97 | swigNext = swigValue+1; 98 | } 99 | 100 | private CodeType(String swigName, CodeType swigEnum) { 101 | this.swigName = swigName; 102 | this.swigValue = swigEnum.swigValue; 103 | swigNext = this.swigValue+1; 104 | } 105 | 106 | private static CodeType[] swigValues = { CODETYPE_USER, CODETYPE_MASTER, CODETYPE_INSTALLER, CODETYPE_ELKRP }; 107 | private static int swigNext = 0; 108 | private final int swigValue; 109 | private final String swigName; 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/UserCodeSuccess.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class UserCodeSuccess { 12 | public final static UserCodeSuccess USERCODE_CHANGE_SUCCESSFUL = new UserCodeSuccess("USERCODE_CHANGE_SUCCESSFUL"); 13 | public final static UserCodeSuccess USERCODE_USER_DUPLICATE = new UserCodeSuccess("USERCODE_USER_DUPLICATE"); 14 | public final static UserCodeSuccess USERCODE_UNAUTHORIZED = new UserCodeSuccess("USERCODE_UNAUTHORIZED"); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static UserCodeSuccess swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + UserCodeSuccess.class + " with value " + swigValue); 31 | } 32 | 33 | private UserCodeSuccess(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private UserCodeSuccess(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private UserCodeSuccess(String swigName, UserCodeSuccess swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static UserCodeSuccess[] swigValues = { USERCODE_CHANGE_SUCCESSFUL, USERCODE_USER_DUPLICATE, USERCODE_UNAUTHORIZED }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/Weekday.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class Weekday { 12 | public final static Weekday Sunday = new Weekday("Sunday", ElkM1APIJNI.Sunday_get()); 13 | public final static Weekday Monday = new Weekday("Monday"); 14 | public final static Weekday Tuesday = new Weekday("Tuesday"); 15 | public final static Weekday Wednesday = new Weekday("Wednesday"); 16 | public final static Weekday Thursday = new Weekday("Thursday"); 17 | public final static Weekday Friday = new Weekday("Friday"); 18 | public final static Weekday Saturday = new Weekday("Saturday"); 19 | 20 | public final int swigValue() { 21 | return swigValue; 22 | } 23 | 24 | public String toString() { 25 | return swigName; 26 | } 27 | 28 | public static Weekday swigToEnum(int swigValue) { 29 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 30 | return swigValues[swigValue]; 31 | for (int i = 0; i < swigValues.length; i++) 32 | if (swigValues[i].swigValue == swigValue) 33 | return swigValues[i]; 34 | throw new IllegalArgumentException("No enum " + Weekday.class + " with value " + swigValue); 35 | } 36 | 37 | private Weekday(String swigName) { 38 | this.swigName = swigName; 39 | this.swigValue = swigNext++; 40 | } 41 | 42 | private Weekday(String swigName, int swigValue) { 43 | this.swigName = swigName; 44 | this.swigValue = swigValue; 45 | swigNext = swigValue+1; 46 | } 47 | 48 | private Weekday(String swigName, Weekday swigEnum) { 49 | this.swigName = swigName; 50 | this.swigValue = swigEnum.swigValue; 51 | swigNext = this.swigValue+1; 52 | } 53 | 54 | private static Weekday[] swigValues = { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }; 55 | private static int swigNext = 0; 56 | private final int swigValue; 57 | private final String swigName; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ZoneDefinition.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class ZoneDefinition { 12 | public final static ZoneDefinition ZONEDEF_DISABLED = new ZoneDefinition("ZONEDEF_DISABLED", ElkM1APIJNI.ZONEDEF_DISABLED_get()); 13 | public final static ZoneDefinition ZONEDEF_BURGLAR_ENTRY_1 = new ZoneDefinition("ZONEDEF_BURGLAR_ENTRY_1", ElkM1APIJNI.ZONEDEF_BURGLAR_ENTRY_1_get()); 14 | public final static ZoneDefinition ZONEDEF_BURGLAR_ENTRY_2 = new ZoneDefinition("ZONEDEF_BURGLAR_ENTRY_2", ElkM1APIJNI.ZONEDEF_BURGLAR_ENTRY_2_get()); 15 | public final static ZoneDefinition ZONEDEF_BURGLAR_PERIMETER_INSTANT = new ZoneDefinition("ZONEDEF_BURGLAR_PERIMETER_INSTANT"); 16 | public final static ZoneDefinition ZONEDEF_BURGLAR_INTERIOR = new ZoneDefinition("ZONEDEF_BURGLAR_INTERIOR"); 17 | public final static ZoneDefinition ZONEDEF_BURGLAR_INTERIOR_FOLLOWER = new ZoneDefinition("ZONEDEF_BURGLAR_INTERIOR_FOLLOWER"); 18 | public final static ZoneDefinition ZONEDEF_BURGLAR_INTERIOR_NIGHT = new ZoneDefinition("ZONEDEF_BURGLAR_INTERIOR_NIGHT"); 19 | public final static ZoneDefinition ZONEDEF_BURGLAR_INTERIOR_NIGHT_DELAY = new ZoneDefinition("ZONEDEF_BURGLAR_INTERIOR_NIGHT_DELAY"); 20 | public final static ZoneDefinition ZONEDEF_BURGLAR_24_HOUR = new ZoneDefinition("ZONEDEF_BURGLAR_24_HOUR"); 21 | public final static ZoneDefinition ZONEDEF_BURGLAR_BOX_TAMPER = new ZoneDefinition("ZONEDEF_BURGLAR_BOX_TAMPER"); 22 | public final static ZoneDefinition ZONEDEF_FIRE_ALARM = new ZoneDefinition("ZONEDEF_FIRE_ALARM"); 23 | public final static ZoneDefinition ZONEDEF_FIRE_VERIFIED = new ZoneDefinition("ZONEDEF_FIRE_VERIFIED"); 24 | public final static ZoneDefinition ZONEDEF_FIRE_SUPERVISORY = new ZoneDefinition("ZONEDEF_FIRE_SUPERVISORY"); 25 | public final static ZoneDefinition ZONEDEF_AUX_ALARM_1 = new ZoneDefinition("ZONEDEF_AUX_ALARM_1"); 26 | public final static ZoneDefinition ZONEDEF_AUX_ALARM_2 = new ZoneDefinition("ZONEDEF_AUX_ALARM_2"); 27 | public final static ZoneDefinition ZONEDEF_KEY_FOB = new ZoneDefinition("ZONEDEF_KEY_FOB"); 28 | public final static ZoneDefinition ZONEDEF_NON_ALARM = new ZoneDefinition("ZONEDEF_NON_ALARM"); 29 | public final static ZoneDefinition ZONEDEF_CARBON_MONOXIDE = new ZoneDefinition("ZONEDEF_CARBON_MONOXIDE"); 30 | public final static ZoneDefinition ZONEDEF_EMERGENCY_ALARM = new ZoneDefinition("ZONEDEF_EMERGENCY_ALARM"); 31 | public final static ZoneDefinition ZONEDEF_FREEZE_ALARM = new ZoneDefinition("ZONEDEF_FREEZE_ALARM"); 32 | public final static ZoneDefinition ZONEDEF_GAS_ALARM = new ZoneDefinition("ZONEDEF_GAS_ALARM"); 33 | public final static ZoneDefinition ZONEDEF_HEAT_ALARM = new ZoneDefinition("ZONEDEF_HEAT_ALARM"); 34 | public final static ZoneDefinition ZONEDEF_MEDICAL_ALARM = new ZoneDefinition("ZONEDEF_MEDICAL_ALARM"); 35 | public final static ZoneDefinition ZONEDEF_POLICE_ALARM = new ZoneDefinition("ZONEDEF_POLICE_ALARM"); 36 | public final static ZoneDefinition ZONEDEF_POLICE_NO_INDICATION = new ZoneDefinition("ZONEDEF_POLICE_NO_INDICATION"); 37 | public final static ZoneDefinition ZONEDEF_WATER_ALARM = new ZoneDefinition("ZONEDEF_WATER_ALARM"); 38 | public final static ZoneDefinition ZONEDEF_KEY_MOMENTARY_ARMDISARM = new ZoneDefinition("ZONEDEF_KEY_MOMENTARY_ARMDISARM"); 39 | public final static ZoneDefinition ZONEDEF_KEY_MOMENTARY_ARM_AWAY = new ZoneDefinition("ZONEDEF_KEY_MOMENTARY_ARM_AWAY"); 40 | public final static ZoneDefinition ZONEDEF_KEY_MOMENTARY_ARM_STAY = new ZoneDefinition("ZONEDEF_KEY_MOMENTARY_ARM_STAY"); 41 | public final static ZoneDefinition ZONEDEF_KEY_MOMENTARY_DISARM = new ZoneDefinition("ZONEDEF_KEY_MOMENTARY_DISARM"); 42 | public final static ZoneDefinition ZONEDEF_KEY_TOGGLE = new ZoneDefinition("ZONEDEF_KEY_TOGGLE"); 43 | public final static ZoneDefinition ZONEDEF_MUTE_AUDIBLES = new ZoneDefinition("ZONEDEF_MUTE_AUDIBLES"); 44 | public final static ZoneDefinition ZONEDEF_POWER_SUPERVISORY = new ZoneDefinition("ZONEDEF_POWER_SUPERVISORY"); 45 | public final static ZoneDefinition ZONEDEF_TEMPERATURE = new ZoneDefinition("ZONEDEF_TEMPERATURE"); 46 | public final static ZoneDefinition ZONEDEF_ANALOG_ZONE = new ZoneDefinition("ZONEDEF_ANALOG_ZONE"); 47 | public final static ZoneDefinition ZONEDEF_PHONE_KEY = new ZoneDefinition("ZONEDEF_PHONE_KEY"); 48 | public final static ZoneDefinition ZONEDEF_INTERCOM_KEY = new ZoneDefinition("ZONEDEF_INTERCOM_KEY"); 49 | 50 | public final int swigValue() { 51 | return swigValue; 52 | } 53 | 54 | public String toString() { 55 | return swigName; 56 | } 57 | 58 | public static ZoneDefinition swigToEnum(int swigValue) { 59 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 60 | return swigValues[swigValue]; 61 | for (int i = 0; i < swigValues.length; i++) 62 | if (swigValues[i].swigValue == swigValue) 63 | return swigValues[i]; 64 | throw new IllegalArgumentException("No enum " + ZoneDefinition.class + " with value " + swigValue); 65 | } 66 | 67 | private ZoneDefinition(String swigName) { 68 | this.swigName = swigName; 69 | this.swigValue = swigNext++; 70 | } 71 | 72 | private ZoneDefinition(String swigName, int swigValue) { 73 | this.swigName = swigName; 74 | this.swigValue = swigValue; 75 | swigNext = swigValue+1; 76 | } 77 | 78 | private ZoneDefinition(String swigName, ZoneDefinition swigEnum) { 79 | this.swigName = swigName; 80 | this.swigValue = swigEnum.swigValue; 81 | swigNext = this.swigValue+1; 82 | } 83 | 84 | private static ZoneDefinition[] swigValues = { ZONEDEF_DISABLED, ZONEDEF_BURGLAR_ENTRY_1, ZONEDEF_BURGLAR_ENTRY_2, ZONEDEF_BURGLAR_PERIMETER_INSTANT, ZONEDEF_BURGLAR_INTERIOR, ZONEDEF_BURGLAR_INTERIOR_FOLLOWER, ZONEDEF_BURGLAR_INTERIOR_NIGHT, ZONEDEF_BURGLAR_INTERIOR_NIGHT_DELAY, ZONEDEF_BURGLAR_24_HOUR, ZONEDEF_BURGLAR_BOX_TAMPER, ZONEDEF_FIRE_ALARM, ZONEDEF_FIRE_VERIFIED, ZONEDEF_FIRE_SUPERVISORY, ZONEDEF_AUX_ALARM_1, ZONEDEF_AUX_ALARM_2, ZONEDEF_KEY_FOB, ZONEDEF_NON_ALARM, ZONEDEF_CARBON_MONOXIDE, ZONEDEF_EMERGENCY_ALARM, ZONEDEF_FREEZE_ALARM, ZONEDEF_GAS_ALARM, ZONEDEF_HEAT_ALARM, ZONEDEF_MEDICAL_ALARM, ZONEDEF_POLICE_ALARM, ZONEDEF_POLICE_NO_INDICATION, ZONEDEF_WATER_ALARM, ZONEDEF_KEY_MOMENTARY_ARMDISARM, ZONEDEF_KEY_MOMENTARY_ARM_AWAY, ZONEDEF_KEY_MOMENTARY_ARM_STAY, ZONEDEF_KEY_MOMENTARY_DISARM, ZONEDEF_KEY_TOGGLE, ZONEDEF_MUTE_AUDIBLES, ZONEDEF_POWER_SUPERVISORY, ZONEDEF_TEMPERATURE, ZONEDEF_ANALOG_ZONE, ZONEDEF_PHONE_KEY, ZONEDEF_INTERCOM_KEY }; 85 | private static int swigNext = 0; 86 | private final int swigValue; 87 | private final String swigName; 88 | } 89 | 90 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ZoneDefinitionVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ZoneDefinitionVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ZoneDefinitionVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ZoneDefinitionVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ZoneDefinitionVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public ZoneDefinitionVector() { 39 | this(ElkM1APIJNI.new_ZoneDefinitionVector__SWIG_0(), true); 40 | } 41 | 42 | public ZoneDefinitionVector(long n) { 43 | this(ElkM1APIJNI.new_ZoneDefinitionVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.ZoneDefinitionVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.ZoneDefinitionVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.ZoneDefinitionVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.ZoneDefinitionVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.ZoneDefinitionVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(SZoneDefinition x) { 67 | ElkM1APIJNI.ZoneDefinitionVector_add(swigCPtr, this, SZoneDefinition.getCPtr(x), x); 68 | } 69 | 70 | public SZoneDefinition get(int i) { 71 | return new SZoneDefinition(ElkM1APIJNI.ZoneDefinitionVector_get(swigCPtr, this, i), false); 72 | } 73 | 74 | public void set(int i, SZoneDefinition val) { 75 | ElkM1APIJNI.ZoneDefinitionVector_set(swigCPtr, this, i, SZoneDefinition.getCPtr(val), val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ZoneState.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ZoneState { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ZoneState(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ZoneState obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ZoneState(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public void setPhysicalState(PhysicalZoneState value) { 39 | ElkM1APIJNI.ZoneState_physicalState_set(swigCPtr, this, value.swigValue()); 40 | } 41 | 42 | public PhysicalZoneState getPhysicalState() { 43 | return PhysicalZoneState.swigToEnum(ElkM1APIJNI.ZoneState_physicalState_get(swigCPtr, this)); 44 | } 45 | 46 | public void setLogicalState(LogicalZoneState value) { 47 | ElkM1APIJNI.ZoneState_logicalState_set(swigCPtr, this, value.swigValue()); 48 | } 49 | 50 | public LogicalZoneState getLogicalState() { 51 | return LogicalZoneState.swigToEnum(ElkM1APIJNI.ZoneState_logicalState_get(swigCPtr, this)); 52 | } 53 | 54 | public ZoneState() { 55 | this(ElkM1APIJNI.new_ZoneState(), true); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/ZoneStateVector.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public class ZoneStateVector { 12 | private transient long swigCPtr; 13 | protected transient boolean swigCMemOwn; 14 | 15 | protected ZoneStateVector(long cPtr, boolean cMemoryOwn) { 16 | swigCMemOwn = cMemoryOwn; 17 | swigCPtr = cPtr; 18 | } 19 | 20 | protected static long getCPtr(ZoneStateVector obj) { 21 | return (obj == null) ? 0 : obj.swigCPtr; 22 | } 23 | 24 | protected void finalize() { 25 | delete(); 26 | } 27 | 28 | public synchronized void delete() { 29 | if (swigCPtr != 0) { 30 | if (swigCMemOwn) { 31 | swigCMemOwn = false; 32 | ElkM1APIJNI.delete_ZoneStateVector(swigCPtr); 33 | } 34 | swigCPtr = 0; 35 | } 36 | } 37 | 38 | public ZoneStateVector() { 39 | this(ElkM1APIJNI.new_ZoneStateVector__SWIG_0(), true); 40 | } 41 | 42 | public ZoneStateVector(long n) { 43 | this(ElkM1APIJNI.new_ZoneStateVector__SWIG_1(n), true); 44 | } 45 | 46 | public long size() { 47 | return ElkM1APIJNI.ZoneStateVector_size(swigCPtr, this); 48 | } 49 | 50 | public long capacity() { 51 | return ElkM1APIJNI.ZoneStateVector_capacity(swigCPtr, this); 52 | } 53 | 54 | public void reserve(long n) { 55 | ElkM1APIJNI.ZoneStateVector_reserve(swigCPtr, this, n); 56 | } 57 | 58 | public boolean isEmpty() { 59 | return ElkM1APIJNI.ZoneStateVector_isEmpty(swigCPtr, this); 60 | } 61 | 62 | public void clear() { 63 | ElkM1APIJNI.ZoneStateVector_clear(swigCPtr, this); 64 | } 65 | 66 | public void add(ZoneState x) { 67 | ElkM1APIJNI.ZoneStateVector_add(swigCPtr, this, ZoneState.getCPtr(x), x); 68 | } 69 | 70 | public ZoneState get(int i) { 71 | return new ZoneState(ElkM1APIJNI.ZoneStateVector_get(swigCPtr, this, i), false); 72 | } 73 | 74 | public void set(int i, ZoneState val) { 75 | ElkM1APIJNI.ZoneStateVector_set(swigCPtr, this, i, ZoneState.getCPtr(val), val); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/java/elkm1api/clearMethod.java: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * Do not make changes to this file unless you know what you are doing--modify 6 | * the SWIG interface file instead. 7 | * ----------------------------------------------------------------------------- */ 8 | 9 | package elkm1api; 10 | 11 | public final class clearMethod { 12 | public final static clearMethod CLEAR = new clearMethod("CLEAR", ElkM1APIJNI.CLEAR_get()); 13 | public final static clearMethod CLEAR_WITH_STAR = new clearMethod("CLEAR_WITH_STAR", ElkM1APIJNI.CLEAR_WITH_STAR_get()); 14 | public final static clearMethod CLEAR_DISPLAY_UNTIL_TIMEOUT = new clearMethod("CLEAR_DISPLAY_UNTIL_TIMEOUT", ElkM1APIJNI.CLEAR_DISPLAY_UNTIL_TIMEOUT_get()); 15 | 16 | public final int swigValue() { 17 | return swigValue; 18 | } 19 | 20 | public String toString() { 21 | return swigName; 22 | } 23 | 24 | public static clearMethod swigToEnum(int swigValue) { 25 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 26 | return swigValues[swigValue]; 27 | for (int i = 0; i < swigValues.length; i++) 28 | if (swigValues[i].swigValue == swigValue) 29 | return swigValues[i]; 30 | throw new IllegalArgumentException("No enum " + clearMethod.class + " with value " + swigValue); 31 | } 32 | 33 | private clearMethod(String swigName) { 34 | this.swigName = swigName; 35 | this.swigValue = swigNext++; 36 | } 37 | 38 | private clearMethod(String swigName, int swigValue) { 39 | this.swigName = swigName; 40 | this.swigValue = swigValue; 41 | swigNext = swigValue+1; 42 | } 43 | 44 | private clearMethod(String swigName, clearMethod swigEnum) { 45 | this.swigName = swigName; 46 | this.swigValue = swigEnum.swigValue; 47 | swigNext = this.swigValue+1; 48 | } 49 | 50 | private static clearMethod[] swigValues = { CLEAR, CLEAR_WITH_STAR, CLEAR_DISPLAY_UNTIL_TIMEOUT }; 51 | private static int swigNext = 0; 52 | private final int swigValue; 53 | private final String swigName; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/jni/swig_wrap_java.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 3.0.10 4 | * 5 | * This file is not intended to be easily readable and contains a number of 6 | * coding conventions designed to improve portability and efficiency. Do not make 7 | * changes to this file unless you know what you are doing--modify the SWIG 8 | * interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | #ifndef SWIG_ElkM1API_WRAP_H_ 12 | #define SWIG_ElkM1API_WRAP_H_ 13 | 14 | class SwigDirector_BoolCallback : public BoolCallback, public Swig::Director { 15 | 16 | public: 17 | void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); 18 | SwigDirector_BoolCallback(JNIEnv *jenv); 19 | virtual void run(bool arg1); 20 | virtual ~SwigDirector_BoolCallback(); 21 | public: 22 | bool swig_overrides(int n) { 23 | return (n < 1 ? swig_override[n] : false); 24 | } 25 | protected: 26 | Swig::BoolArray<1> swig_override; 27 | }; 28 | 29 | class SwigDirector_IntCallback : public IntCallback, public Swig::Director { 30 | 31 | public: 32 | void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); 33 | SwigDirector_IntCallback(JNIEnv *jenv); 34 | virtual void run(int arg1); 35 | virtual ~SwigDirector_IntCallback(); 36 | public: 37 | bool swig_overrides(int n) { 38 | return (n < 1 ? swig_override[n] : false); 39 | } 40 | protected: 41 | Swig::BoolArray<1> swig_override; 42 | }; 43 | 44 | class SwigDirector_ArmStatusVectorCallback : public ArmStatusVectorCallback, public Swig::Director { 45 | 46 | public: 47 | void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); 48 | SwigDirector_ArmStatusVectorCallback(JNIEnv *jenv); 49 | virtual void run(std::vector< Elk::ArmStatus > status); 50 | virtual ~SwigDirector_ArmStatusVectorCallback(); 51 | public: 52 | bool swig_overrides(int n) { 53 | return (n < 1 ? swig_override[n] : false); 54 | } 55 | protected: 56 | Swig::BoolArray<1> swig_override; 57 | }; 58 | 59 | class SwigDirector_M1Connection : public Elk::M1Connection, public Swig::Director { 60 | 61 | public: 62 | void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); 63 | SwigDirector_M1Connection(JNIEnv *jenv); 64 | virtual ~SwigDirector_M1Connection(); 65 | virtual bool Connect(std::string location, int port); 66 | virtual void Disconnect(); 67 | virtual void Send(std::vector< char > data); 68 | virtual std::vector< char > Recieve(); 69 | public: 70 | bool swig_overrides(int n) { 71 | return (n < 4 ? swig_override[n] : false); 72 | } 73 | protected: 74 | Swig::BoolArray<4> swig_override; 75 | }; 76 | 77 | class SwigDirector_C1M1Tunnel : public Elk::C1M1Tunnel, public Swig::Director { 78 | 79 | public: 80 | void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); 81 | SwigDirector_C1M1Tunnel(JNIEnv *jenv, Elk::M1Connection *underlying); 82 | virtual ~SwigDirector_C1M1Tunnel(); 83 | virtual bool Connect(std::string location, int port); 84 | virtual void Disconnect(); 85 | virtual void Send(std::vector< char > data); 86 | virtual std::vector< char > Recieve(); 87 | public: 88 | bool swig_overrides(int n) { 89 | return (n < 4 ? swig_override[n] : false); 90 | } 91 | protected: 92 | Swig::BoolArray<4> swig_override; 93 | }; 94 | 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /ElkM1AndroidExample/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 |