├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── C# ├── Client GazeFlowAPI │ ├── Client GazeFlowAPI.sln │ ├── Client GazeFlowAPI.suo │ └── Client GazeFlowAPI │ │ ├── Client GazeFlowAPI.csproj │ │ ├── GazeFlowAPI.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── bin │ │ ├── Debug │ │ ├── Client GazeFlowAPI.exe │ │ ├── Client GazeFlowAPI.pdb │ │ └── Client GazeFlowAPI.vshost.exe │ │ └── Release │ │ ├── Client GazeFlowAPI.exe │ │ ├── Client GazeFlowAPI.pdb │ │ ├── Client GazeFlowAPI.vshost.exe │ │ └── Client GazeFlowAPI.vshost.exe.manifest └── GazeFlowAPI.cs ├── CONTRIBUTING.md ├── GazeFlowAPI.cs ├── HTML5 JavaScript └── GazeFlowAPI.html └── README.md /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client GazeFlowAPI", "Client GazeFlowAPI\Client GazeFlowAPI.csproj", "{DAC9FB66-01A1-4193-9F55-B2C78764D7B8}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {DAC9FB66-01A1-4193-9F55-B2C78764D7B8}.Debug|x86.ActiveCfg = Debug|x86 13 | {DAC9FB66-01A1-4193-9F55-B2C78764D7B8}.Debug|x86.Build.0 = Debug|x86 14 | {DAC9FB66-01A1-4193-9F55-B2C78764D7B8}.Release|x86.ActiveCfg = Release|x86 15 | {DAC9FB66-01A1-4193-9F55-B2C78764D7B8}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI.suo -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/Client GazeFlowAPI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {DAC9FB66-01A1-4193-9F55-B2C78764D7B8} 9 | Exe 10 | Properties 11 | Client_GazeFlowAPI 12 | Client GazeFlowAPI 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 58 | -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/GazeFlowAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text; 6 | using System.Net.Sockets; 7 | using System.IO; 8 | using System.Xml; 9 | using System.Xml.Serialization; 10 | using System.Threading; 11 | 12 | 13 | namespace GazeFlowAPI//GazeScreamClient 14 | { 15 | [Serializable()] 16 | public class CGazeData 17 | { 18 | public float GazeX; 19 | public float GazeY; 20 | 21 | public float HeadX; 22 | public float HeadY; 23 | public float HeadZ; 24 | public float HeadYaw; 25 | public float HeadPitch; 26 | public float HeadRoll; 27 | 28 | } 29 | 30 | 31 | class CGazeFlowAPI 32 | { 33 | 34 | NetworkStream stream; 35 | TcpClient client; 36 | 37 | // Byte[] dataBufor; 38 | 39 | BinaryReader reader; 40 | BinaryWriter writer; 41 | 42 | 43 | public CGazeData ReciveGazeDataSyn() 44 | { 45 | CGazeData GazeData; 46 | 47 | if (!client.Connected) 48 | return null; 49 | 50 | 51 | String responseData; 52 | 53 | 54 | try 55 | { 56 | responseData = reader.ReadString(); 57 | } 58 | catch 59 | { 60 | Disconect(); // connection lost 61 | return null; 62 | } 63 | 64 | try 65 | { 66 | XmlSerializer serializer = new XmlSerializer(typeof(CGazeData)); 67 | using (TextReader readerxml = new StringReader(responseData)) 68 | { 69 | GazeData = (CGazeData)serializer.Deserialize(readerxml); 70 | } 71 | 72 | } 73 | catch 74 | { 75 | 76 | Console.WriteLine( responseData); // server close connetion 77 | Disconect(); 78 | return null; 79 | 80 | } 81 | 82 | return GazeData; 83 | } 84 | 85 | 86 | 87 | //To get your AppKey register at http://gazeflow.epizy.com/GazeFlowAPI/register/ 88 | public bool Connect( string adress= "127.0.0.1", Int32 port = 43333,string AppKey = "AppKeyDemo") 89 | { 90 | 91 | string ResultFormat = "xml"; 92 | try 93 | { 94 | // Create a TcpClient. 95 | // Note, for this client to work you need to have a TcpServer 96 | // connected to the same address as specified by the server, port 97 | // combination. 98 | 99 | client = new TcpClient(adress, port); 100 | 101 | if (!client.Connected) 102 | return false; 103 | 104 | 105 | stream = client.GetStream(); 106 | 107 | reader = new BinaryReader(stream); 108 | writer = new BinaryWriter(stream); 109 | 110 | 111 | 112 | if (true) // version type 113 | { 114 | // Translate the ResultFormat into UTF8 and store it as a Byte array. 115 | 116 | Byte[] data = System.Text.Encoding.UTF8.GetBytes(ResultFormat); 117 | // Send ResultFormat to the connected TcpServer. 118 | stream.Write(data, 0, data.Length); 119 | } 120 | 121 | 122 | // Send appkey string to the connected TcpServer. 123 | writer.Write(AppKey); 124 | 125 | // Receive the TcpServer.response. 126 | 127 | 128 | string connectionInfo = reader.ReadString(); 129 | 130 | Console.WriteLine("connectionStatus: " + connectionInfo); 131 | 132 | string connectionStatus = connectionInfo.Substring(0, 2); 133 | 134 | bool AutoryzationOk = true; 135 | 136 | if (connectionStatus != "ok") 137 | AutoryzationOk = false; 138 | 139 | 140 | if (!client.Connected || !AutoryzationOk) 141 | { 142 | // invalid appKey 143 | Disconect(); 144 | return false; 145 | } 146 | 147 | return true; 148 | 149 | } 150 | catch 151 | { 152 | Disconect(); 153 | return false; 154 | } 155 | 156 | } 157 | 158 | 159 | void Disconect() 160 | { 161 | try 162 | { 163 | reader.Close(); 164 | writer.Close(); 165 | stream.Close(); 166 | client.Close(); 167 | 168 | 169 | 170 | } 171 | catch 172 | { 173 | } 174 | } 175 | 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using GazeFlowAPI; 6 | 7 | 8 | namespace Client_GazeFlowAPI 9 | { 10 | class Program 11 | { 12 | 13 | 14 | 15 | static void Main(string[] args) 16 | { 17 | 18 | 19 | CGazeFlowAPI gazeFlowAPI = new CGazeFlowAPI(); 20 | 21 | 22 | //To get your AppKey register at http://gazeflow.epizy.com/GazeFlowAPI/register/ 23 | 24 | string AppKey = "AppKeyDemo"; 25 | 26 | if (gazeFlowAPI.Connect( "127.0.0.1", 43333,AppKey)) 27 | { 28 | 29 | 30 | while ( true ) 31 | { 32 | CGazeData GazeData = gazeFlowAPI.ReciveGazeDataSyn(); 33 | if (GazeData == null) 34 | { 35 | Console.WriteLine("Disconected"); 36 | return; 37 | } 38 | else 39 | { 40 | 41 | Console.WriteLine("Gaze: {0} , {1}", GazeData.GazeX, GazeData.GazeY); 42 | Console.WriteLine("Head: {0} , {1}, {2}", GazeData.HeadX, GazeData.HeadY, GazeData.HeadZ); 43 | Console.WriteLine("Head rot : {0} , {1}, {2}", GazeData.HeadYaw, GazeData.HeadPitch, GazeData.HeadRoll); 44 | Console.WriteLine(""); 45 | } 46 | } 47 | 48 | 49 | } 50 | else 51 | Console.WriteLine("Connection fail"); 52 | 53 | 54 | 55 | 56 | Console.Read(); 57 | 58 | 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Client GazeFlowAPI")] 9 | [assembly: AssemblyDescription("Tets GazeFlowAPI")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("GazeFlow")] 12 | [assembly: AssemblyProduct("Client GazeFlowAPI")] 13 | [assembly: AssemblyCopyright("Copyright GazeFlow© 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8b4ed0a8-eef7-4eda-83d7-2918189bafd0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Debug/Client GazeFlowAPI.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Debug/Client GazeFlowAPI.exe -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Debug/Client GazeFlowAPI.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Debug/Client GazeFlowAPI.pdb -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Debug/Client GazeFlowAPI.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Debug/Client GazeFlowAPI.vshost.exe -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.exe -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.pdb -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szydej/GazeFlowAPI/730e8f8defce64c4ca4bcf2bff911a5bdefe1bfa/C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.vshost.exe -------------------------------------------------------------------------------- /C#/Client GazeFlowAPI/Client GazeFlowAPI/bin/Release/Client GazeFlowAPI.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /C#/GazeFlowAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text; 6 | using System.Net.Sockets; 7 | using System.IO; 8 | using System.Xml; 9 | using System.Xml.Serialization; 10 | using System.Threading; 11 | 12 | 13 | namespace GazeFlowAPI//GazeScreamClient 14 | { 15 | [Serializable()] 16 | public class CGazeData 17 | { 18 | public float GazeX; 19 | public float GazeY; 20 | 21 | public float HeadX; 22 | public float HeadY; 23 | public float HeadZ; 24 | public float HeadYaw; 25 | public float HeadPitch; 26 | public float HeadRoll; 27 | 28 | } 29 | 30 | 31 | class CGazeFlowAPI 32 | { 33 | 34 | NetworkStream stream; 35 | TcpClient client; 36 | 37 | // Byte[] dataBufor; 38 | 39 | BinaryReader reader; 40 | BinaryWriter writer; 41 | 42 | 43 | public CGazeData ReciveGazeDataSyn() 44 | { 45 | CGazeData GazeData; 46 | 47 | if (!client.Connected) 48 | return null; 49 | 50 | 51 | String responseData; 52 | 53 | 54 | try 55 | { 56 | responseData = reader.ReadString(); 57 | } 58 | catch 59 | { 60 | Disconect(); // connection lost 61 | return null; 62 | } 63 | 64 | try 65 | { 66 | XmlSerializer serializer = new XmlSerializer(typeof(CGazeData)); 67 | using (TextReader readerxml = new StringReader(responseData)) 68 | { 69 | GazeData = (CGazeData)serializer.Deserialize(readerxml); 70 | } 71 | 72 | } 73 | catch 74 | { 75 | 76 | Console.WriteLine( responseData); // server close connetion 77 | Disconect(); 78 | return null; 79 | 80 | } 81 | 82 | return GazeData; 83 | } 84 | 85 | 86 | 87 | //To get your AppKey register at http://gazeflow.epizy.com/GazeFlowAPI/register/ 88 | public bool Connect( string adress= "127.0.0.1", Int32 port = 43333,string AppKey = "AppKeyDemo") 89 | { 90 | 91 | string ResultFormat = "xml"; 92 | try 93 | { 94 | // Create a TcpClient. 95 | // Note, for this client to work you need to have a TcpServer 96 | // connected to the same address as specified by the server, port 97 | // combination. 98 | 99 | client = new TcpClient(adress, port); 100 | 101 | if (!client.Connected) 102 | return false; 103 | 104 | 105 | stream = client.GetStream(); 106 | 107 | reader = new BinaryReader(stream); 108 | writer = new BinaryWriter(stream); 109 | 110 | 111 | 112 | if (true) // version type 113 | { 114 | // Translate the ResultFormat into UTF8 and store it as a Byte array. 115 | 116 | Byte[] data = System.Text.Encoding.UTF8.GetBytes(ResultFormat); 117 | // Send ResultFormat to the connected TcpServer. 118 | stream.Write(data, 0, data.Length); 119 | } 120 | 121 | 122 | // Send appkey string to the connected TcpServer. 123 | writer.Write(AppKey); 124 | 125 | // Receive the TcpServer.response. 126 | 127 | 128 | string connectionInfo = reader.ReadString(); 129 | 130 | Console.WriteLine("connectionStatus: " + connectionInfo); 131 | 132 | string connectionStatus = connectionInfo.Substring(0, 2); 133 | 134 | bool AutoryzationOk = true; 135 | 136 | if (connectionStatus != "ok") 137 | AutoryzationOk = false; 138 | 139 | 140 | if (!client.Connected || !AutoryzationOk) 141 | { 142 | // invalid appKey 143 | Disconect(); 144 | return false; 145 | } 146 | 147 | return true; 148 | 149 | } 150 | catch 151 | { 152 | Disconect(); 153 | return false; 154 | } 155 | 156 | } 157 | 158 | 159 | void Disconect() 160 | { 161 | try 162 | { 163 | reader.Close(); 164 | writer.Close(); 165 | stream.Close(); 166 | client.Close(); 167 | 168 | 169 | 170 | } 171 | catch 172 | { 173 | } 174 | } 175 | 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /GazeFlowAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text; 6 | using System.Net.Sockets; 7 | using System.IO; 8 | using System.Xml; 9 | using System.Xml.Serialization; 10 | using System.Threading; 11 | 12 | 13 | namespace GazeFlowAPI//GazeScreamClient 14 | { 15 | [Serializable()] 16 | public class CGazeData 17 | { 18 | public float GazeX; 19 | public float GazeY; 20 | 21 | public float HeadX; 22 | public float HeadY; 23 | public float HeadZ; 24 | public float HeadYaw; 25 | public float HeadPitch; 26 | public float HeadRoll; 27 | 28 | } 29 | 30 | 31 | class CGazeFlowAPI 32 | { 33 | 34 | NetworkStream stream; 35 | TcpClient client; 36 | 37 | // Byte[] dataBufor; 38 | 39 | BinaryReader reader; 40 | BinaryWriter writer; 41 | 42 | 43 | public CGazeData ReciveGazeDataSyn() 44 | { 45 | CGazeData GazeData; 46 | 47 | if (!client.Connected) 48 | return null; 49 | 50 | 51 | String responseData; 52 | 53 | 54 | try 55 | { 56 | responseData = reader.ReadString(); 57 | } 58 | catch 59 | { 60 | Disconect(); // connection lost 61 | return null; 62 | } 63 | 64 | try 65 | { 66 | XmlSerializer serializer = new XmlSerializer(typeof(CGazeData)); 67 | using (TextReader readerxml = new StringReader(responseData)) 68 | { 69 | GazeData = (CGazeData)serializer.Deserialize(readerxml); 70 | } 71 | 72 | } 73 | catch 74 | { 75 | 76 | Console.WriteLine( responseData); // server close connetion 77 | Disconect(); 78 | return null; 79 | 80 | } 81 | 82 | return GazeData; 83 | } 84 | 85 | 86 | 87 | //To get your AppKey register at http://gazeflow.epizy.com/GazeFlowAPI/register/ 88 | public bool Connect( string adress= "127.0.0.1", Int32 port = 43333,string AppKey = "AppKeyDemo") 89 | { 90 | 91 | string ResultFormat = "xml"; 92 | try 93 | { 94 | // Create a TcpClient. 95 | // Note, for this client to work you need to have a TcpServer 96 | // connected to the same address as specified by the server, port 97 | // combination. 98 | 99 | client = new TcpClient(adress, port); 100 | 101 | if (!client.Connected) 102 | return false; 103 | 104 | 105 | stream = client.GetStream(); 106 | 107 | reader = new BinaryReader(stream); 108 | writer = new BinaryWriter(stream); 109 | 110 | 111 | 112 | if (true) // version type 113 | { 114 | // Translate the ResultFormat into UTF8 and store it as a Byte array. 115 | 116 | Byte[] data = System.Text.Encoding.UTF8.GetBytes(ResultFormat); 117 | // Send ResultFormat to the connected TcpServer. 118 | stream.Write(data, 0, data.Length); 119 | } 120 | 121 | 122 | // Send appkey string to the connected TcpServer. 123 | writer.Write(AppKey); 124 | 125 | // Receive the TcpServer.response. 126 | 127 | 128 | string connectionInfo = reader.ReadString(); 129 | 130 | Console.WriteLine("connectionStatus: " + connectionInfo); 131 | 132 | string connectionStatus = connectionInfo.Substring(0, 2); 133 | 134 | bool AutoryzationOk = true; 135 | 136 | if (connectionStatus != "ok") 137 | AutoryzationOk = false; 138 | 139 | 140 | if (!client.Connected || !AutoryzationOk) 141 | { 142 | // invalid appKey 143 | Disconect(); 144 | return false; 145 | } 146 | 147 | return true; 148 | 149 | } 150 | catch 151 | { 152 | Disconect(); 153 | return false; 154 | } 155 | 156 | } 157 | 158 | 159 | void Disconect() 160 | { 161 | try 162 | { 163 | reader.Close(); 164 | writer.Close(); 165 | stream.Close(); 166 | client.Close(); 167 | 168 | 169 | 170 | } 171 | catch 172 | { 173 | } 174 | } 175 | 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /HTML5 JavaScript/GazeFlowAPI.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
104 | 105 | 106 |

107 |

108 |

109 | 110 | 111 | 112 |
113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GazeFlowAPI 2 | WebCam based Eye-Tracking API 3 | 4 | 5 | With GazeFlowAPI you can access real-time gaze and head position data from GazePointer WebCam Eye-Tracker (https://sourceforge.net/projects/gazepointer/). 6 | 7 | 8 | 9 | How to use it: 10 | 11 | 1. Install and start GazePointer (download: https://sourceforge.net/projects/gazepointer/) 12 | 13 | 2. To get your AppKey register at http://gazeflow.epizy.com/GazeFlowAPI/register/ 14 | You can use default AppKey for testing. 15 | 16 | 3. Connect to GazePointer and start reciving gaze data. 17 | a) Use TCP socket ( check GazeFlowAPI.cs source code for details ). 18 | b) Use WebSocket ( check /HTML5 JavaScript/GazeFlowAPI.html source code for details ). 19 | 20 | 21 | 22 | You can also chek out GazeCloudAPI https://api.gazerecorder.com/ for Cross-Platform online Eye-Tracking 23 | 24 | 25 | Read More: https://gazerecorder.com 26 | --------------------------------------------------------------------------------