..
 #############################################################
 # This file was automatically generated on 2015-05-08.      #
 #                                                           #
 # If you have a bugfix for this file and want to commit it, #
 # please fix the bug in the generator. You can find a link  #
 # to the generators git repository on tinkerforge.com       #
 #############################################################


:breadcrumbs: <a href="../../index.html">Home</a> / <a href="../../index.html#software-tcpip">Software</a> / TCP/IP - Motion Detector Bricklet

.. |device_identifier_constant| unicode:: 0xA0
   :trim:

.. _motion_detector_bricklet_tcpip:

TCP/IP - Motion Detector Bricklet
=================================

This is the description of the :ref:`TCP/IP protocol <llproto_tcpip>` for the :ref:`Motion Detector Bricklet <motion_detector_bricklet>`. General information and technical
specifications for the Motion Detector Bricklet are summarized in its :ref:`hardware description
<motion_detector_bricklet_description>`.

.. _motion_detector_bricklet_tcpip_api:

API
---

A general description of the TCP/IP protocol structure can be found
:ref:`here <llproto_tcpip>`.




Basic Functions
^^^^^^^^^^^^^^^



.. tcpip:function:: BrickletMotionDetector.get_motion_detected

 :functionid: 1
 :emptyrequest: empty payload

 :response motion: uint8

 Returns 1 if a motion was detected. How long this returns 1 after a motion
 was detected can be adjusted with one of the small potentiometers on the
 Motion Detector Bricklet, see :ref:`here
 <motion_detector_bricklet_sensitivity_delay_block_time>`.
 
 There is also a blue LED on the Bricklet that is on as long as the Bricklet is
 in the "motion detected" state.
 


Advanced Functions
^^^^^^^^^^^^^^^^^^

.. tcpip:function:: BrickletMotionDetector.get_identity

 :functionid: 255
 :emptyrequest: empty payload

 :response uid: char[8]
 :response connected_uid: char[8]
 :response position: char
 :response hardware_version: uint8[3]
 :response firmware_version: uint8[3]
 :response device_identifier: uint16

 Returns the UID, the UID where the Bricklet is connected to, 
 the position, the hardware and firmware version as well as the
 device identifier.
 
 The position can be 'a', 'b', 'c' or 'd'.
 
 The device identifier numbers can be found :ref:`here <device_identifier>`.
 |device_identifier_constant|
 


.. _motion_detector_bricklet_tcpip_callbacks:

Callbacks
^^^^^^^^^

.. tcpip:function:: BrickletMotionDetector.CALLBACK_MOTION_DETECTED

 :functionid: 2

 :emptyresponse: empty payload


 This callback is called after a motion was detected.
 
.. tcpip:function:: BrickletMotionDetector.CALLBACK_DETECTION_CYCLE_ENDED

 :functionid: 3

 :emptyresponse: empty payload


 This callback is called when the detection cycle ended. When this
 callback is called, a new motion can be detected again after approximately 2
 seconds.
 


