\doxysection{pygaze.\+\_\+eyetracker.\+pytribe.\+connection Class Reference}
\hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection}{}\label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a345b8513cf49f7a55ed648bcaa47cde1}{\+\_\+\+\_\+init\+\_\+\+\_\+}} (self, \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3f6f9644aacd28cde81ea4f1cd414725}{host}}=\textquotesingle{}localhost\textquotesingle{}, \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3ee52f16768a988085595a680acdc08b}{port}}=6555)
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a74af3335f70080400faec3795b8ebf80}{request}} (self, category, request, values)
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a69f6cb3aab7bebf8f56b442cb1dc2e65}{create\+\_\+json}} (self, category, \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a74af3335f70080400faec3795b8ebf80}{request}}, values)
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_adb05437ef9e83b44f7cf90d33003f57f}{parse\+\_\+json}} (self, jsonmsg)
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aa81f71a49b4e8578aa350b4e4c251926}{revive}} (self)
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a1fa262dbc0a2c82d21efc0379844a16d}{close}} (self)
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3f6f9644aacd28cde81ea4f1cd414725}{host}} = host
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3ee52f16768a988085595a680acdc08b}{port}} = port
\item 
bool \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_ab4c1b926f7d3a8f01f97c7a1b542cd67}{DEBUG}} = False
\item 
float \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_af75148f1ff65514fdf95d8a5219ed9d7}{response\+\_\+timeout}} = 1.\+0
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_adcc5e6e677b10dbeda749cdbf8ea67a9}{sock}} = socket.\+socket(socket.\+AF\+\_\+\+INET, socket.\+SOCK\+\_\+\+STREAM)
\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_ab5423a4117fb8a3ffbca5df022adac92}{\+\_\+get\+\_\+responses}} (self)
\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
dict \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a355adc21347862592e119bf087c4b963}{\+\_\+responses}}
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aaef07b6074881de318db15f94d6d21c2}{\+\_\+request\+\_\+lock}} = Lock()
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a5bdc02f96f9f1b5827f475152d4e751e}{\+\_\+debugfile}} = open(\textquotesingle{}DEBUG\+\_\+output.\+txt\textquotesingle{}, \textquotesingle{}w\textquotesingle{})
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a325067f2886273ddcafc434e63eaf551}{\+\_\+debuglock}} = Lock()
\item 
bool \mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aaaf0a19d14041c947f3488244cb871b3}{\+\_\+listening}} = True
\item 
\mbox{\hyperlink{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a96923ca920701558304f404b071061e4}{\+\_\+listenthread}} = Thread(target=self.\+\_\+get\+\_\+responses, args=\mbox{[}$\,$\mbox{]})
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\begin{DoxyVerb}class for connections with the EyeTribe tracker\end{DoxyVerb}
 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a345b8513cf49f7a55ed648bcaa47cde1}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_\_init\_\_@{\_\_init\_\_}}
\index{\_\_init\_\_@{\_\_init\_\_}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_\_init\_\_()}{\_\_init\_\_()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a345b8513cf49f7a55ed648bcaa47cde1} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+\+\_\+init\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{}]{self}{, }\item[{}]{host}{ = {\ttfamily \textquotesingle{}localhost\textquotesingle{}}, }\item[{}]{port}{ = {\ttfamily 6555}}\end{DoxyParamCaption})}

\begin{DoxyVerb}Initializes the connection with the EyeTribe tracker

        keyword arguments

        host        --  a string indicating the host IP, NOTE: currently only
                    'localhost' is supported (default = 'localhost')
        port        --  an integer indicating the port number, NOTE: currently
                    only 6555 is supported (default = 6555)
\end{DoxyVerb}
 

\doxysubsection{Member Function Documentation}
\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_ab5423a4117fb8a3ffbca5df022adac92}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_get\_responses@{\_get\_responses}}
\index{\_get\_responses@{\_get\_responses}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_get\_responses()}{\_get\_responses()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_ab5423a4117fb8a3ffbca5df022adac92} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+get\+\_\+responses (\begin{DoxyParamCaption}\item[{}]{self}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}

\begin{DoxyVerb}INTERNAL USE ONLY. This method is run in a sub-Thread, to listen
        to the EyeTribe, and to process all its responses. Responses are
        stored in a 
\end{DoxyVerb}
 \Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a1fa262dbc0a2c82d21efc0379844a16d}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!close@{close}}
\index{close@{close}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{close()}{close()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a1fa262dbc0a2c82d21efc0379844a16d} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+close (\begin{DoxyParamCaption}\item[{}]{self}{}\end{DoxyParamCaption})}

\begin{DoxyVerb}Closes the connection to the EyeTribe tracker
\end{DoxyVerb}
 \Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a69f6cb3aab7bebf8f56b442cb1dc2e65}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!create\_json@{create\_json}}
\index{create\_json@{create\_json}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{create\_json()}{create\_json()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a69f6cb3aab7bebf8f56b442cb1dc2e65} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+create\+\_\+json (\begin{DoxyParamCaption}\item[{}]{self}{, }\item[{}]{category}{, }\item[{}]{request}{, }\item[{}]{values}{}\end{DoxyParamCaption})}

\begin{DoxyVerb}Creates a new json message, in the format that is required by the
        EyeTribe tracker; these messages consist of a categort, a request and
        a (list of) value(s), which can be thought of as class.method.value
        (for more info, see: http://dev.theeyetribe.com/api/)

        arguments

        category    --  query category (string), e.g. 'tracker',
                    'calibration', or 'heartbeat'
        request --  the request message (string), e.g. 'get' for the
                    'tracker' category
        values  --  a dict of parameters and their values, e.g.
                    {"push":True, "version":1}
                    OR:
                    a list of parameters, e.g. ['push','iscalibrated']
                    OR:
                    None to pass no values at all

        keyword arguments

        None

        returns

        jsonmsg --  a string in json format, that can be directly sent to
                    the EyeTribe tracker
\end{DoxyVerb}
 \Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_adb05437ef9e83b44f7cf90d33003f57f}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!parse\_json@{parse\_json}}
\index{parse\_json@{parse\_json}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{parse\_json()}{parse\_json()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_adb05437ef9e83b44f7cf90d33003f57f} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+parse\+\_\+json (\begin{DoxyParamCaption}\item[{}]{self}{, }\item[{}]{jsonmsg}{}\end{DoxyParamCaption})}

\begin{DoxyVerb}Parses a json message as those that are usually returned by the
        EyeTribe tracker
        (for more info, see: http://dev.theeyetribe.com/api/)

        arguments

        jsonmsg --  a string in json format

        keyword arguments

        None

        returns

        msg     --  a dict containing the information in the json message;
                    this dict has the following content:
                        {   "category": "tracker",
                            "request":  "get",
                            "statuscode":   200,
                            "values":   {   "push":True,
                                        "iscalibrated":True
                                        }
                            }
\end{DoxyVerb}
 \Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a74af3335f70080400faec3795b8ebf80}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!request@{request}}
\index{request@{request}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{request()}{request()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a74af3335f70080400faec3795b8ebf80} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+request (\begin{DoxyParamCaption}\item[{}]{self}{, }\item[{}]{category}{, }\item[{}]{request}{, }\item[{}]{values}{}\end{DoxyParamCaption})}

\begin{DoxyVerb}Send a message over the connection

        arguments

        category    --  string indicating the query category
        request --  string indicating the actual request of the message
        values  --  dict or list containing parameters of the request
\end{DoxyVerb}
 \Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aa81f71a49b4e8578aa350b4e4c251926}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!revive@{revive}}
\index{revive@{revive}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{revive()}{revive()}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aa81f71a49b4e8578aa350b4e4c251926} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+revive (\begin{DoxyParamCaption}\item[{}]{self}{}\end{DoxyParamCaption})}

\begin{DoxyVerb}Re-establishes a connection
\end{DoxyVerb}
 

\doxysubsection{Member Data Documentation}
\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a5bdc02f96f9f1b5827f475152d4e751e}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_debugfile@{\_debugfile}}
\index{\_debugfile@{\_debugfile}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_debugfile}{\_debugfile}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a5bdc02f96f9f1b5827f475152d4e751e} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+debugfile = open(\textquotesingle{}DEBUG\+\_\+output.\+txt\textquotesingle{}, \textquotesingle{}w\textquotesingle{})\hspace{0.3cm}{\ttfamily [protected]}}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a325067f2886273ddcafc434e63eaf551}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_debuglock@{\_debuglock}}
\index{\_debuglock@{\_debuglock}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_debuglock}{\_debuglock}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a325067f2886273ddcafc434e63eaf551} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+debuglock = Lock()\hspace{0.3cm}{\ttfamily [protected]}}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aaaf0a19d14041c947f3488244cb871b3}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_listening@{\_listening}}
\index{\_listening@{\_listening}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_listening}{\_listening}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aaaf0a19d14041c947f3488244cb871b3} 
bool pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+listening = True\hspace{0.3cm}{\ttfamily [protected]}}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a96923ca920701558304f404b071061e4}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_listenthread@{\_listenthread}}
\index{\_listenthread@{\_listenthread}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_listenthread}{\_listenthread}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a96923ca920701558304f404b071061e4} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+listenthread = Thread(target=self.\+\_\+get\+\_\+responses, args=\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\ttfamily [protected]}}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aaef07b6074881de318db15f94d6d21c2}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_request\_lock@{\_request\_lock}}
\index{\_request\_lock@{\_request\_lock}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_request\_lock}{\_request\_lock}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_aaef07b6074881de318db15f94d6d21c2} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+request\+\_\+lock = Lock()\hspace{0.3cm}{\ttfamily [protected]}}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a355adc21347862592e119bf087c4b963}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!\_responses@{\_responses}}
\index{\_responses@{\_responses}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{\_responses}{\_responses}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a355adc21347862592e119bf087c4b963} 
dict pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+\_\+responses\hspace{0.3cm}{\ttfamily [protected]}}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_ab4c1b926f7d3a8f01f97c7a1b542cd67}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!DEBUG@{DEBUG}}
\index{DEBUG@{DEBUG}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{DEBUG}{DEBUG}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_ab4c1b926f7d3a8f01f97c7a1b542cd67} 
bool pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+DEBUG = False}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3f6f9644aacd28cde81ea4f1cd414725}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!host@{host}}
\index{host@{host}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{host}{host}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3f6f9644aacd28cde81ea4f1cd414725} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+host = host}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3ee52f16768a988085595a680acdc08b}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!port@{port}}
\index{port@{port}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{port}{port}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_a3ee52f16768a988085595a680acdc08b} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+port = port}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_af75148f1ff65514fdf95d8a5219ed9d7}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!response\_timeout@{response\_timeout}}
\index{response\_timeout@{response\_timeout}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{response\_timeout}{response\_timeout}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_af75148f1ff65514fdf95d8a5219ed9d7} 
float pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+response\+\_\+timeout = 1.\+0}

\Hypertarget{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_adcc5e6e677b10dbeda749cdbf8ea67a9}\index{pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}!sock@{sock}}
\index{sock@{sock}!pygaze.\_eyetracker.pytribe.connection@{pygaze.\_eyetracker.pytribe.connection}}
\doxysubsubsection{\texorpdfstring{sock}{sock}}
{\footnotesize\ttfamily \label{classpygaze_1_1__eyetracker_1_1pytribe_1_1connection_adcc5e6e677b10dbeda749cdbf8ea67a9} 
pygaze.\+\_\+eyetracker.\+pytribe.\+connection.\+sock = socket.\+socket(socket.\+AF\+\_\+\+INET, socket.\+SOCK\+\_\+\+STREAM)}



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
C\+:/\+Users/lurax/eyetracking\+Tobii/pygaze/\+\_\+eyetracker/\mbox{\hyperlink{pytribe_8py}{pytribe.\+py}}\end{DoxyCompactItemize}
