BOOST_FIXTURE_TEST_CASE( no_service_no_cookies, test::request_with_reponse< without_gap_service_service > )
{
    // Find By Type Value Request, 1, 0xffff, <<primary service>>, <<gap service>>
    check_error_response(
        { 0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x11, 0x47 },
        0x06, 0x0001, 0x0a
    );
}
BOOST_FIXTURE_TEST_CASE( no_service_no_appearance, test::request_with_reponse< without_gap_service_service > )
{
    // Read by Type Request, 0x0001, 0xffff, 0x2A01
    check_error_response(
        { 0x08, 0x01, 0x00, 0xff, 0xff, 0x01, 0x2A },
        0x08, 0x0001, 0x0a
    );
}
BOOST_FIXTURE_TEST_CASE( unsupprorted_group_type_128bit, small_temperature_service_with_response<> )
{
    // every type but the «Primary Service» is invalid for GATT
    BOOST_CHECK( check_error_response(
        {
            0x10, 0x01, 0x00, 0xff, 0xff,
            0x00, 0x01, 0x02, 0x03,
            0x04, 0x05, 0x06, 0x06,
            0x08, 0x09, 0x0a, 0x0b,
            0x0c, 0x0d, 0x0e, 0x0f
        }, 0x10, 0x0001, 0x10 ) );
}
Example #4
0
BOOST_FIXTURE_TEST_CASE( handle_out_of_range, small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x08, 0x40, 0x00, 0xff, 0xff, 0x00, 0x28 }, 0x08, 0x0040, 0x0A ) );
}
Example #5
0
BOOST_FIXTURE_TEST_CASE( start_handle_greater_than_end_handle, small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x08, 0x05, 0x00, 0x04, 0x00, 0x03, 0x28 }, 0x08, 0x0005, 0x01 ) );
}
Example #6
0
BOOST_FIXTURE_TEST_CASE( start_handle_zero, small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x08, 0x00, 0x00, 0xff, 0xff, 0x03, 0x28 }, 0x08, 0x0000, 0x01 ) );
}
BOOST_FIXTURE_TEST_CASE( no_write_buffer, test::request_with_reponse< test::three_apes_service > )
{
    BOOST_CHECK( check_error_response( { 0x16, 0x03, 0x00, 0x00, 0x00, 0xab  }, 0x16, 0x0000, 0x06 ) );
}
BOOST_FIXTURE_TEST_CASE( write_queue_full, test::request_with_reponse< large_value_server_with_small_queue > )
{
    BOOST_CHECK( check_error_response(
        { 0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
        0x16, 0x0003, 0x09 ) );
}
Example #9
0
BOOST_FIXTURE_TEST_CASE( invalid_handle, test::small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x0A, 0x00, 0x00 }, 0x0A, 0x0000, 0x01 ) );
}
BOOST_FIXTURE_TEST_CASE( no_such_handle, large_fixture )
{
    BOOST_CHECK( check_error_response( { 0x16, 0x17, 0xAA, 0x00, 0x00, 0x12, 0x23 }, 0x16, 0xAA17, 0x0A ) );
}
BOOST_FIXTURE_TEST_CASE( pdu_to_small, large_fixture )
{
    BOOST_CHECK( check_error_response( { 0x16, 0x03, 0x00 }, 0x16, 0x0000, 0x04 ) );
}
BOOST_FIXTURE_TEST_CASE( request_out_of_range, small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response(
        { 0x10, 0x02, 0x00, 0xff, 0xff, 0x00, 0x28 }, 0x10, 0x0002, 0x0a ) );

}
BOOST_FIXTURE_TEST_CASE( unsupprorted_group_type, small_temperature_service_with_response<> )
{
    // every type but the «Primary Service» is invalid for GATT
    BOOST_CHECK( check_error_response( { 0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28 }, 0x10, 0x0001, 0x10 ) );
}
Example #14
0
BOOST_FIXTURE_TEST_CASE( pdu_to_small, test::small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x0A, 0x02 }, 0x0A, 0x0000, 0x04 ) );
}
Example #15
0
BOOST_FIXTURE_TEST_CASE( not_readable, test::request_with_reponse< unreadable_server > )
{
    BOOST_CHECK( check_error_response( { 0x0A, 0x03, 0x00 }, 0x0A, 0x0003, 0x02 ) );
}
Example #16
0
BOOST_FIXTURE_TEST_CASE( no_such_type, small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x08, 0x01, 0x00, 0xff, 0xff, 0xab, 0xcd }, 0x08, 0x0001, 0x0A ) );
}
Example #17
0
BOOST_FIXTURE_TEST_CASE( invalid_request_size, small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x08, 0x01, 0x00, 0xff, 0xff, 0x03 }, 0x08, 0x0000, 0x04 ) );
    BOOST_CHECK( check_error_response( { 0x08, 0x01, 0x00, 0xff, 0xff, 0x03, 0x04, 0x05, 0x06 }, 0x08, 0x0000, 0x04 ) );
}
BOOST_FIXTURE_TEST_CASE( invalid_handle, large_fixture )
{
    BOOST_CHECK( check_error_response( { 0x16, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0000, 0x01 ) );
}
BOOST_FIXTURE_TEST_CASE( write_protected, large_fixture )
{
    BOOST_CHECK( check_error_response( { 0x16, 0x01, 0x00, 0x00, 0x00 }, 0x16, 0x0001, 0x03 ) );
}
Example #20
0
BOOST_FIXTURE_TEST_CASE( no_such_handle, test::small_temperature_service_with_response<> )
{
    BOOST_CHECK( check_error_response( { 0x0A, 0x17, 0xAA }, 0x0A, 0xAA17, 0x0A ) );
    BOOST_CHECK( check_error_response( { 0x0A, 0x04, 0x00 }, 0x0A, 0x0004, 0x0A ) );
}