A method performed by a first device, for sending data in a Device-to-Device, D2D, transmission to a second device is provided. After the first device has identified a priority level of the D2D transmission, it maps the identified priority level to a resource pool index. The resource pool index identifies a resource pool among a plurality of resource pools associated with different priority levels. The first device then sends the data in the D2D transmission to the second device, using the resources in the resource pool identified by the resource pool index.