# Path: pypozyx/definitions/registers.py
# POZYX_WHO_AM_I = 0x0  # Returns the constant value 0x43.
# 
# POZYX_CONFIG_GPIO1 = 0x27  # Configure GPIO pin 1.


from pypozyx import *
from pypozyx.definitions.registers import POZYX_WHO_AM_I, POZYX_CONFIG_GPIO1


def test_read_register(pozyx, remote):
    status = pozyx.getRead(POZYX_WHO_AM_I, SingleRegister(), remote)
    assert status == POZYX_SUCCESS, "register read unsuccessful"


def test_read_5_registers(pozyx, remote):
    status = pozyx.getRead(POZYX_WHO_AM_I, Data(data=[0] * 10), remote)
    assert status == POZYX_SUCCESS, "10 register read unsuccessful"


def test_read_50_registers(pozyx, remote):
    status = pozyx.getRead(POZYX_WHO_AM_I, Data(data=[0] * 50), remote)
    assert status == POZYX_SUCCESS, "50 register read unsuccessful"


def test_read_who_am_i(pozyx, remote):
    who_am_i = SingleRegister()
    status = pozyx.getRead(POZYX_WHO_AM_I, who_am_i, remote)
    assert status == POZYX_SUCCESS, "couldn't read POZYX_WHO_AM_I register"
    assert who_am_i.value == 0x43, "POZYX_WHO_AM_I register has a wrong value"


def test_write_register(pozyx, remote):
    status = pozyx.setWrite(
        POZYX_CONFIG_GPIO1, SingleRegister(0x10), remote)
    assert status == POZYX_SUCCESS, "register write unsuccessful"
    config_gpio1 = SingleRegister()
    status = pozyx.getRead(

# Path: pypozyx/definitions/registers.py
# POZYX_WHO_AM_I = 0x0  # Returns the constant value 0x43.
# 
# POZYX_CONFIG_GPIO1 = 0x27  # Configure GPIO pin 1.


# Path: unit_tests/test_core.py
from pypozyx import *
from pypozyx.definitions.registers import POZYX_WHO_AM_I, POZYX_CONFIG_GPIO1



def test_read_register(pozyx, remote):
    status = pozyx.getRead(POZYX_WHO_AM_I, SingleRegister(), remote)
    assert status == POZYX_SUCCESS, "register read unsuccessful"


def test_read_5_registers(pozyx, remote):
    status = pozyx.getRead(POZYX_WHO_AM_I, Data(data=[0] * 10), remote)
    assert status == POZYX_SUCCESS, "10 register read unsuccessful"


def test_read_50_registers(pozyx, remote):
    status = pozyx.getRead(POZYX_WHO_AM_I, Data(data=[0] * 50), remote)
    assert status == POZYX_SUCCESS, "50 register read unsuccessful"


def test_read_who_am_i(pozyx, remote):
    who_am_i = SingleRegister()
    status = pozyx.getRead(POZYX_WHO_AM_I, who_am_i, remote)
    assert status == POZYX_SUCCESS, "couldn't read POZYX_WHO_AM_I register"
    assert who_am_i.value == 0x43, "POZYX_WHO_AM_I register has a wrong value"


def test_write_register(pozyx, remote):
    status = pozyx.setWrite(
        POZYX_CONFIG_GPIO1, SingleRegister(0x10), remote)
    assert status == POZYX_SUCCESS, "register write unsuccessful"
    config_gpio1 = SingleRegister()
    status = pozyx.getRead(

        POZYX_CONFIG_GPIO1, config_gpio1, remote) == POZYX_SUCCESS